OpenAPI Specification
PickLayer generates an OpenAPI 3.0 specification for all end-user API endpoints. This specification can be used for API documentation, client SDK generation, and API testing.
Endpoints
| Endpoint | Description |
|---|---|
GET /openapi/openapi.json | OpenAPI 3.0 JSON specification |
GET /openapi/ui | Swagger UI for interactive API exploration |
Accessing the Spec
The OpenAPI spec is publicly accessible (no authentication required):
# Fetch the OpenAPI spec
curl https://api.picklayer.ai/openapi/openapi.json
# Or with org/app context for custom domains
curl https://api.mychatapp.com/openapi/openapi.jsonOpenAI Compatibility
The generated spec documents PickLayer’s OpenAI-compatible endpoints:
| PickLayer Endpoint | OpenAI Equivalent | Status |
|---|---|---|
/v1/chat/completions | /v1/chat/completions | Full compatibility |
/v1/responses | /v1/responses | Full compatibility |
/v1/audio/speech | /v1/audio/speech | Full compatibility |
/v1/audio/transcriptions | /v1/audio/transcriptions | Full compatibility |
/v1/images/generations | /v1/images/generations | Full compatibility |
/v1/files | /v1/files | Full compatibility |
/v1/models | /v1/models | Extended with provider grouping |
/v1/videos | /v1/videos | Full compatibility (async) |
PickLayer Extensions
The following endpoints are PickLayer-specific:
- Auth (
/v1/auth/*) - User authentication and registration - Billing (
/v1/billing/*) - Subscription and payment management - Data (
/v1/data/*) - User data storage - Videos (
/v1/videos/*) - Video generation - Prompts (
/v1/prompts/*) - Schema-enforced prompt invocation - Relay (
/v1/relay/*) - External API proxying
Server URL Template
The spec includes a parameterized server URL:
https://{host}/api/org/{orgHandler}/app/{appHandler}/{env}Variables:
host- API host (default:api.picklayer.ai)orgHandler- Organization slugappHandler- Application slugenv- Environment:dev,stage, orprod(default:prod)
SDK Generation
Use the OpenAPI spec to generate client SDKs in any language:
# Generate TypeScript client
npx openapi-generator-cli generate \
-i https://api.picklayer.ai/openapi/openapi.json \
-g typescript-fetch \
-o ./generated/typescript
# Generate Python client
npx openapi-generator-cli generate \
-i https://api.picklayer.ai/openapi/openapi.json \
-g python \
-o ./generated/python
# Validate the spec
npx @redocly/cli lint https://api.picklayer.ai/openapi/openapi.jsonOfficial SDKs
PickLayer also provides official SDKs with built-in support for all endpoints:
- Python:
pip install picklayer - TypeScript/Node.js:
npm install @picklayer/sdk
Interactive Documentation
Visit /openapi/ui in your browser to explore the API interactively with Swagger UI:
https://api.picklayer.ai/openapi/uiThis provides:
- Interactive request/response examples
- Authentication testing
- Schema exploration
- Try-it-out functionality
Last updated on