Bring your own SDK.
Keep one DIT key.
DIT exposes multiple protocol-compatible gateway entries behind the same API key. Point your client at the base URL below, choose the protocol your app already speaks, and route text, multimodal, and music traffic through a single buyer-side credential.
Create a key
Sign in to /dashboard, mint a runtime API key, and copy the plain token immediately.
Discover models
Call /v1/models with the same bearer token to see the slugs and supported protocol surface.
Call the route you need
Use chat, responses, messages, music, or generateContent against the same base URL.
Quickstart
Use the same bearer token across discovery and inference. The gateway enforces auth and rate limiting before protocol routing.
Model discovery example
curl https://api.dit.ai/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"{
"object": "list",
"data": [
{
"id": "gpt-5.4",
"object": "model",
"owned_by": "apiexchange",
"status": "ready",
"supported_protocols": [
"openai_chat_completions",
"openai_responses"
]
},
{
"id": "claude-sonnet-4-6",
"object": "model",
"owned_by": "apiexchange",
"status": "ready",
"supported_protocols": [
"openai_chat_completions",
"openai_responses",
"anthropic_messages"
]
},
{
"id": "grok-imagine-video",
"object": "model",
"owned_by": "apiexchange",
"status": "ready",
"supported_protocols": [
"xai_video_generations"
]
},
{
"id": "suno-v6-wild",
"object": "model",
"owned_by": "apiexchange",
"status": "ready",
"supported_protocols": [
"music_generations"
]
}
],
"request_id": "req_xxx"
}Protocols
The following request examples mirror the protocol routes currently registered by the gateway.
Chat Completions
Default chat entry for OpenAI-compatible SDKs and most assistant-style traffic.
curl https://api.dit.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5.4",
"stream": false,
"temperature": 0,
"max_tokens": 64,
"messages": [
{ "role": "user", "content": "Reply with exactly: v1-chat-ok" }
]
}'{
"id": "chatcmpl_xxx",
"object": "chat.completion",
"created": 1710000000,
"model": "gpt-5.4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "v1-chat-ok"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 4,
"total_tokens": 16
},
"request_id": "req_xxx"
}Responses
Unified Responses-style interface for clients already using the newer OpenAI response schema.
curl https://api.dit.ai/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5.4",
"max_output_tokens": 64,
"input": [
{
"role": "user",
"content": [
{ "type": "input_text", "text": "Reply with exactly: v1-responses-ok" }
]
}
]
}'{
"id": "resp_xxx",
"object": "response",
"created_at": 1710000000,
"model": "gpt-5.4",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{ "type": "output_text", "text": "v1-responses-ok" }
]
}
],
"request_id": "req_xxx"
}Messages
Anthropic Messages-compatible entry for Claude-style message blocks.
curl https://api.dit.ai/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 64,
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Reply with exactly: v1-anthropic-ok" }
]
}
]
}'{
"id": "msg_xxx",
"type": "message",
"role": "assistant",
"model": "claude-sonnet-4-6",
"content": [
{ "type": "text", "text": "v1-anthropic-ok" }
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 12,
"output_tokens": 4
},
"request_id": "req_xxx"
}Video Generations
xAI Grok Imagine-compatible asynchronous video generation route.
REQUEST_ID=$(curl -s https://api.dit.ai/v1/videos/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-imagine-video",
"prompt": "A glowing crystal-powered rocket launching from the red dunes of Mars, cinematic, synchronized audio",
"duration": 10,
"aspect_ratio": "16:9",
"resolution": "720p"
}' | jq -r '.request_id')
curl https://api.dit.ai/v1/videos/$REQUEST_ID \
-H "Authorization: Bearer YOUR_API_KEY"{
"status": "done",
"video": {
"url": "https://vidgen.x.ai/.../video.mp4",
"duration": 10,
"respect_moderation": true
},
"model": "grok-imagine-video"
}Music Generations
Provider-neutral asynchronous music generation for Suno models, with one route for submission and status polling.
MUSIC_REQUEST_ID=$(curl -sS https://api.dit.ai/v1/music/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "suno-v6-wild",
"prompt": "A luminous synthwave anthem for a midnight drive",
"style": "synthwave, energetic, female vocal",
"title": "Neon Horizon",
"instrumental": false
}' | jq -r '.request_id')
curl https://api.dit.ai/v1/music/generations/$MUSIC_REQUEST_ID \
-H "Authorization: Bearer YOUR_API_KEY"{
"id": "1305183664787431425",
"request_id": "1305183664787431425",
"object": "music.generation",
"model": "suno-v6-wild",
"status": "done",
"outputs": [
{
"id": "2d6b301a-517d-4430-824e-60088fc0b76d",
"status": "done",
"title": "Neon Horizon",
"duration": 197.88,
"progress": 100,
"audio_url": "https://example.com/generated-song.m4a",
"error": null
}
],
"billing": {
"actual_cost": 0.06,
"currency": "USD"
}
}YunApi-compatible Suno
Drop-in compatibility for YunApi's native Suno request and response fields.
TASK_BATCH_ID=$(curl -sS https://api.dit.ai/_open/suno/music/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"inputType": 10,
"gptDescriptionPrompt": "A warm ambient piano instrumental",
"tags": "warm piano, ambient, relaxing",
"title": "Quiet Morning",
"mv": "chirp-v6-mini",
"makeInstrumental": true
}' | jq -r '.data.taskBatchId')
curl "https://api.dit.ai/_open/suno/music/getState?taskBatchId=$TASK_BATCH_ID" \
-H "Authorization: Bearer YOUR_API_KEY"{
"code": 200,
"msg": "99",
"data": {
"taskBatchId": "1305183664787431425",
"taskStatus": "finished",
"items": [
{
"clipId": "2d6b301a-517d-4430-824e-60088fc0b76d",
"status": 30,
"title": "Quiet Morning",
"progress": 100,
"cld2AudioUrl": "https://example.com/generated-song.m4a",
"cld2ImageUrl": "https://example.com/generated-cover.jpg"
}
]
}
}Generate Content (Text)
Google Gemini-style content generation route exposed through the same DIT API key.
curl https://api.dit.ai/v1beta/models/gemini-3.1-pro-preview:generateContent \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Reply with exactly: v1-google-ok" }
]
}
],
"generationConfig": {
"temperature": 0,
"maxOutputTokens": 64
}
}'{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{ "text": "v1-google-ok" }
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 9,
"candidatesTokenCount": 3,
"totalTokenCount": 12
},
"request_id": "req_xxx"
}Conventions
Shared rules across the gateway for instrumentation, retries, and debugging.
Request IDs
Every gateway response includes `x-request-id`. JSON responses also carry `request_id` in the payload.
Protocol gating
If a model route does not expose the protocol you called, expect a `protocol_unsupported` error.
Asynchronous generation
Music submissions return a task `request_id`. Poll the matching status route until the task reaches `done`, `failed`, or `expired`.
Streaming
Text routes can stream when the upstream path supports it. Music generation currently rejects `stream: true`.
Typical error shape
{
"error": {
"code": "protocol_unsupported",
"message": "Model <slug> does not support /v1/chat/completions"
},
"request_id": "req_xxx"
}