Slice one operation out of an OpenAPI 3.0 or 3.1 document with every component it needs
Extracts one operation (path plus HTTP method, matching templated paths like /pets/{id}) from an OpenAPI 3.0.x or 3.1.x document, given as JSON, YAML or a parsed object, and returns a smaller valid OpenAPI document holding that operation, its path-level parameters and servers, and the transitive closure of every local $ref it uses: schemas, parameters, requestBodies, responses, headers, examples, links, callbacks, pathItems, securitySchemes and discriminator mappings, cycle safe. For agents that need to put one endpoint of a large API into a prompt or a tool definition. External file or URL references are listed and the status is unsupported, never silently dropped. It does not validate the document and does not dereference (references stay as $ref).
What you get
A 2 MB API description shrinks to the few KB one call needs, with nothing missing. 400 KB of JSON, 50 KB of YAML or 120,000 nodes per $0.005 call.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/openapi-slice. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/openapi-slice \
-H 'content-type: application/json' \
-d '{"specText":"openapi: 3.0.3\ninfo: {title: Pets, version: '\''1'\''}\npaths:\n /pets/{id}:\n get:\n operationId: getPet\n parameters:\n - $ref: '\''#/components/parameters/Id'\''\n responses:\n '\''200'\'':\n description: ok\n content:\n application/json:\n schema: {$ref: '\''#/components/schemas/Pet'\''}\n /owners:\n get:\n responses:\n '\''200'\'': {description: ok}\ncomponents:\n parameters:\n Id: {name: id, in: path, required: true, schema: {type: string}}\n schemas:\n Pet: {type: object, properties: {friends: {type: array, items: {$ref: '\''#/components/schemas/Pet'\''}}}}\n Unused: {type: string}\n","path":"/pets/42","method":"get"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
spec | any | no | The OpenAPI document as a JSON object (use specText for YAML). |
specText | string; length 0..400000 | no | The OpenAPI document as JSON text (up to 400000 characters) or YAML text (up to 50000 characters). |
path | string; length 0..500 | yes | Concrete or templated path, e.g. /pets/{petId} or /pets/42. |
method | string; one of "get", "put", "post", "delete", "options", "head", "patch", "trace" | yes |
Example request body
{
"specText": "openapi: 3.0.3\ninfo: {title: Pets, version: '1'}\npaths:\n /pets/{id}:\n get:\n operationId: getPet\n parameters:\n - $ref: '#/components/parameters/Id'\n responses:\n '200':\n description: ok\n content:\n application/json:\n schema: {$ref: '#/components/schemas/Pet'}\n /owners:\n get:\n responses:\n '200': {description: ok}\ncomponents:\n parameters:\n Id: {name: id, in: path, required: true, schema: {type: string}}\n schemas:\n Pet: {type: object, properties: {friends: {type: array, items: {$ref: '#/components/schemas/Pet'}}}}\n Unused: {type: string}\n",
"path": "/pets/42",
"method": "get"
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
slice | one of | no | |
matchedPath | one of | no | |
templateMatch | boolean | no | True when path matched a templated key such as /pets/{id}. |
operationId | one of | no | |
openapi | one of | no | |
included | object | no | |
unresolved | array<object> | no | |
sizes | object | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the data-contract-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent