OpenAPI Specification
The complete DOS AI API is documented using the OpenAPI Specification (OAS 3.1.0). You can access the machine-readable specification in either YAML or JSON format:
These specifications can be used with tools like Swagger UI, Postman, Insomnia, Scalar, or any OpenAPI-compatible SDK code generator to explore the API, run tests, or generate strongly typed client libraries.
What is in the Specification?
The specification covers all core endpoints and capabilities of DOS AI:
Chat
POST /v1/chat/completions
Chat completions, streaming SSE, tool calling, JSON schema mode, and per-request cost calculation.
API Keys
GET /v1/key, GET /v1/auth/key
API key metadata, usage, and balance checking (compatible with OpenRouter format).
Billing & Balance
GET /v1/user/balance, GET /v1/credits
Balance and credit queries (compatible with CC Switch, DeepSeek, and NewAPI formats).
Models
GET /v1/models, GET /v1/models/{model_id}
Dynamic model catalog with context windows and per-token pricing.
Embeddings
POST /v1/embeddings
Text embeddings generation.
Anthropic Messages
POST /v1/messages, POST /v1/messages/count_tokens
Anthropic-compatible Messages API and zero-cost token counting.
Batches
POST /v1/files, POST /v1/batches, GET /v1/batches/{id}
Asynchronous batch processing at 50% discount.
Media Generation
POST /v1/{images,videos,audio}/generations
Multimodal generation for images, videos, and music.
Using with Postman / Insomnia
You can import the complete DOS AI API collection into Postman or Insomnia with a single click:
Open Postman (or Insomnia).
Click Import in the top left corner.
Paste the URL:
Click Import. Postman will generate an organized collection with all endpoints, headers, and request body templates.
Set your collection variable
apiKeyto your DOS AI API key (dos_sk_...) and start sending requests immediately.
Using with Swagger UI / Scalar
To run an interactive Swagger UI locally with the DOS AI specification:
Visit http://localhost:8080 in your browser to inspect and interact with the endpoints.
Generating Client SDKs
You can use the official OpenAPI Generator or modern tools like Fern or Stainless to automatically generate type-safe client libraries for your tech stack:
Python Client
TypeScript / Node.js Client
Go Client
Authentication in OpenAPI
All endpoints (except public routes such as GET /v1/models) require Bearer token authentication defined by the BearerAuth security scheme:
Last updated