Documentation project instructions
About this project
- These are the public developer docs for the Deepshi API — an OpenAI-compatible gateway that gives developers access to Deepshi’s models and third-party models via a single API.
- Built on Mintlify. Pages are MDX files with YAML frontmatter. Configuration lives in
docs.json. - The gateway is based on Bifrost. Source lives in
../deepshi-api. The public product site is deepshi.ai. - Use the Mintlify MCP server
https://mcp.mintlify.comto edit content/settings, andhttps://www.mintlify.com/docs/mcpto query Mintlify usage.
Audience & scope
- Audience: developers consuming the API. They get an
sk-bf-...key from the deepshi.ai dashboard and call the OpenAI-compatible/v1/*endpoints. - In scope: the
/v1/*inference endpoints, authentication with API keys, models, credits/pricing, errors, SDK usage. - Out of scope (do NOT document): the admin/management plane (
/api/*), virtual-key minting, customer/budget governance, reconcile crons, Modal/Supabase deployment, and any internal infra. Those are Deepshi’s own backend integration, not for API customers.
Terminology
- “API key” / “key” — the user’s
sk-bf-...secret. Don’t call it a “virtual key” (that’s internal terminology). - “credits” / “balance” — the user’s prepaid USD balance. Don’t expose “customer”, “wallet”, or “budget” internals.
- “model id” — the value of the
modelfield, taken fromGET /v1/models. IDs are clean (no provider prefix):gpt-4o,claude-opus-4.8,deepshi-3.0, etc. — NOTopenai/.... - Documented endpoints:
GET /v1/models,POST /v1/chat/completions, the image endpointsPOST /v1/images/generationsandPOST /v1/images/edits, the video endpointsPOST /v1/videos,GET /v1/videos/{id},GET /v1/videos/{id}/content, andDELETE /v1/videos/{id}, and the music endpointsPOST /v1/audio/generations,GET /v1/audio/generations/{id}, andGET /v1/audio/generations/{id}/content. Still NOT exposed: speech/transcription audio, embeddings, and/v1/completions. Source of truth:deepshi-api/docs/deployment-guides/api_docs.mdandmodels.md. - Video models use an asynchronous job API: create a job (
POST /v1/videos), poll it (GET /v1/videos/{id}) untilstatusiscompleted, then readvideos[].urlor follow the/content302 redirect. Beyondmodelandprompt, they take model-specific params (resolution,duration,aspect_ratio,generate_audio,input_referencefor image-to-video) discovered viaGET /v1/models. Pricing is per second of output, billed once on completion; unlike chat/image, video responses do NOT carry an inlineusage.cost. Video ids are per-key. Seecapabilities/video-generation.mdxandmodels/video-models.mdx. - Music (audio) models use an asynchronous job API: create a job (
POST /v1/audio/generations), poll it (GET /v1/audio/generations/{id}) untilstatusiscompleted, then readaudio[].urlor follow the/content302 redirect. There is no delete/cancel endpoint (unlike video). The launch model isminimax-music-v2(MiniMax Music 2.0): it takes a styleprompt(≤300 chars) plus a requiredlyrics_prompt(10–3000 chars,[Verse]/[Chorus]tags) and generates a vocal song — it does NOT do instrumental-only output. Optional output params (sample_rate,bitrate,format— mp3 only) come fromGET /v1/models(theparametersobject). Create returnsstatus: "in_progress"(nosize/seconds); the completed poll addsaudio[],seconds(string), andcompleted_at. Pricing is flat per track, billed once on completion; like video, responses do NOT carry an inlineusage.cost. Audio ids are per-key. Seecapabilities/audio-generation.mdxandmodels/audio-models.mdx. - Image models use a fixed request schema (standard fields) plus model-specific sizing/quality params (
width/height,aspect_ratio,resolution,quality,image_size) that vary by model — callers discover them viaGET /v1/models(theparametersobject, plus the top-leveledit,prompt_max_length, and modality fields). Pricing is NOT in/v1/models; image pricing is per-image and tier-aware (oftenresolution×quality), shown on deepshi.ai, and every response returns the actualusage.cost. Responses do not expose the internaldeepshi_resolvedecho. Seecapabilities/image-generation.mdx. - Deepshi’s own models: Deepshi 2.0 (
deepshi-2.0, largely uncensored; no tools/reasoning/json) and Deepshi 3.0 (deepshi-3.0, multimodal flagship; tools, reasoning, json, logprobs). Do NOT use old “Flow/Forge” or “R1/R2” names. - Default example model in docs:
deepshi-3.0(supports all features). Mentiondeepshi-2.0as the uncensored option. - Frontier text models (clean ids):
claude-opus-4.8/4.7,claude-sonnet-4.6,gpt-5.5/5.4/4.1/4o,gemini-3.5-flash,grok-4.3/4.20,glm-5.2/5.1/5,kimi-k2.6,gemma-4-31b-it. - Pricing is USD per 1M tokens. Every response carries
usage.cost.total_cost(Deepshi extension, USD). - Reasoning: control it with the
reasoning_effortrequest param (none/low/medium/high; omit for the model’s default). The response surfaces the trace asmessage.reasoning+message.reasoning_details(NOTreasoning_content). Lowmax_tokenscan yield emptycontent+finish_reason: length(normal 200). - Use “Deepshi API” for the product; “deepshi.ai” for the site/dashboard.
Facts to keep accurate
- Base URL documented as
https://api.deepshi.ai/v1(branded placeholder; the live gateway is on Modal). - Auth header:
Authorization: Bearer sk-bf-.... - Status codes:
200ok,400model_not_found/invalid_request_error,401invalid_api_key,402insufficient_quota(out of credits),403revoked/not permitted,429rate-limited. - The API is OpenAI-compatible; the OpenAI SDKs work by changing base URL + key.
- Model catalogue (ids, context, pricing, capabilities) comes from
models.md. Keepmodels/text-models.mdxin sync with it.
Style preferences
- Use active voice and second person (“you”).
- Keep sentences concise — one idea per sentence.
- Use sentence case for headings.
- Bold for UI elements: Click Create key.
- Code formatting for file names, commands, paths, model ids, and code references.
- Code examples: prefer a
<CodeGroup>with curl / Python / JavaScript tabs. Python and JS use the OpenAI SDK pointed at the Deepshi base URL.
Content boundaries
- Never include real secrets, admin credentials, internal hostnames (e.g.
*.modal.run), or database details. - Mark anything unverified with a
{/* TBD: ... */}MDX comment rather than guessing as fact.