Base URL
Authentication
All requests require a bearer token:Authentication
Create a key, send it as a bearer token, and keep it safe.
Errors
Status codes and the JSON error object, with handling tips.
Endpoints
Chat and image requests are synchronous: the response carries the result. Video and music requests are asynchronous: they return a job that you poll until it completes.
Conventions
- Format: JSON request and response bodies, matching the OpenAI schema.
- Streaming: Set
"stream": truefor Server-Sent Events. The final chunk carries ausageobject withcost. See Streaming. - Usage & cost: Synchronous responses (chat and image) include a
usageobject; Deepshi addsusage.cost.total_cost, the USD cost of the request, drawn from your balance. Asynchronous video and music jobs do not carry an inlineusage.cost; check per-model rates and your balance on deepshi.ai. - Errors: Standard HTTP status codes with a JSON
errorobject. See Errors.