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 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, 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"
]
}
],
"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"
}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.
Streaming
Available on protocol-compatible routes when the upstream path supports it.
Typical error shape
{
"error": {
"code": "protocol_unsupported",
"message": "Model <slug> does not support /v1/chat/completions"
},
"request_id": "req_xxx"
}