Packages

Generate a package

POST
/generate

Returns one generated package without creating a Project.

Supports idempotent retries; keyed responses include generated files in the replay cache.

Use download.url to save the complete ZIP, verify download.sha256, and extract it into an empty directory. The link expires at download.expires_at and grants access to anyone who has it. CLI, MCP, and SDK calls supply an idempotency key automatically. Agents should request fields=["download","coverage","warnings","claim"] to keep the MCP result compact; files can exceed the response limit. Download the ZIP instead of repeating generation to retrieve omitted files.

Anonymous and Free requests include the first 25 operations. Paid plans include all operations. Anonymous requests are rate limited by IP address. Check coverage for omitted operations; an invalid API key returns 401.

An anonymous URL request without source headers may return claim.url. Sign in through that link within seven days to save the recipe as a Project.

AuthorizationBearer <token>

Organization API key from the console (ak_...), or an OAuth access token with user:org:read, the organization selected during consent, and the capability required by the operation.

In: header

Header Parameters

Idempotency-Key?string

Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization uses a hashed network identity. Retrying the same method, path, query, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write.

Match^[!-~]+$
Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/generate" \  -H "Content-Type: application/json" \  -d '{    "spec": {      "url": "https://typeship.dev/examples/petstore/openapi.yaml"    },    "target": {      "type": "cli"    }  }'

{  "object": "package",  "files": [    {      "path": "README.md",      "content": "# petstore-cli\n\nCLI for Petstore. [API reference](./api.md)\n"    }  ],  "warnings": [],  "coverage": {    "generated": 20,    "omitted": 0,    "total": 20,    "omitted_operations": []  },  "request_id": "req_3k8m1v6q9p2d7h4c"}