# WritersLogic OpenAPI Slice Extractor

> WritersLogic OpenAPI Slice Extractor is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Extracts a single operation from an OpenAPI 3.0.x/3.1.x document and returns a minimal valid OpenAPI document containing only that operation and its transitive $ref dependencies.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/openapi-slice?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-openapi-slice-extractor-93e0e54c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VNo0QxbTYI5EiKcDuCn5F

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-openapi-slice-extractor-93e0e54c -d '<json body>'
```

Example prompt: Can you slice out just the POST /pets endpoint from this OpenAPI spec and give me a minimal valid OpenAPI document with all its schemas and $refs included? Here's the full spec as YAML text.

## When to prefer this

Use this endpoint when you need to put a single API operation into an LLM prompt or agent tool definition and the full OpenAPI document is too large to include. It is the right choice when you need all $ref dependencies transitively resolved and kept as $refs (not dereferenced), and when you want external references explicitly flagged rather than silently ignored. Prefer it over manual extraction when the spec has deeply nested component references that are tedious to trace by hand.

## Known failure modes

- Path not found in the spec — returns an error if the specified path/method combination does not exist
- Invalid OpenAPI version — only 3.0.x and 3.1.x are supported; older Swagger 2.0 specs will fail
- Malformed JSON/YAML — if specText cannot be parsed, an error is returned
- specText exceeds 400,000 character JSON limit or 50,000 character YAML limit
- External $refs listed but not resolved — callers expecting dereferenced output will be disappointed
- Both spec (object) and specText provided — ambiguous input may cause unexpected behavior

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

A smaller, fully valid OpenAPI 3.0.x or 3.1.x document containing: the requested operation and its HTTP method, path-level parameters and servers, and the transitive closure of all locally referenced components (schemas, parameters, requestBodies, responses, headers, examples, links, callbacks, pathItems, securitySchemes, discriminator mappings). External file or URL $refs are listed with an 'unsupported' status rather than silently dropped. References remain as $refs (not dereferenced).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "path": {
   "type": "string",
   "maxLength": 500,
   "description": "Concrete or templated path, e.g. /pets/{petId} or /pets/42."
  },
  "spec": {
   "description": "The OpenAPI document as a JSON object (use specText for YAML)."
  },
  "method": {
   "enum": [
    "get",
    "put",
    "post",
    "delete",
    "options",
    "head",
    "patch",
    "trace"
   ],
   "type": "string"
  },
  "specText": {
   "type": "string",
   "maxLength": 400000,
   "description": "The OpenAPI document as JSON text (up to 400000 characters) or YAML text (up to 50000 characters)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-openapi-slice-extractor-93e0e54c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
