API रेफ़रेंस

एक base URL। हर मॉडल।

किसी भी OpenAI या Anthropic SDK को unbottled.ai पर पॉइंट करें। Codex CLI और Claude Code भी। इमेज, वॉइस, वीडियो और म्यूज़िक उसी key पर। कोई नया क्लाइंट सीखने की ज़रूरत नहीं।

126 चैट मॉडलOpenAI + Anthropic फ़ॉर्मेटस्ट्रीमिंग और टूल कॉलकोई फ़िक्स्ड रेट लिमिट नहीं
शुरुआत

क्विकस्टार्ट

यह API OpenAI और Anthropic दोनों का वायर फ़ॉर्मेट बोलता है। जो कोड इनमें से किसी पर चलता है, वह यहाँ सिर्फ़ दो बदलाव के बाद चलेगा: base URL और key।

1
Key बनाएँ

अपने अकाउंट में API keys खोलें, key को नाम दें, कॉपी करें। यह सिर्फ़ एक बार दिखती है।

2
Base URL सेट करें

अपने क्लाइंट में base URL बदलें। Anthropic क्लाइंट दूसरा वाला लेते हैं।

OpenAI base URL
https://unbottled.ai/api/hi-IN/v1

पाथ में कोई भी लोकेल चलेगा (en-US, de-DE, pl-PL)। इससे सिर्फ़ एरर मैसेज की भाषा बदलती है।

Anthropic base URL
https://unbottled.ai/api/hi-IN

Claude Code और Anthropic SDK के लिए। आखिर में /v1 नहीं: वे /v1/messages खुद जोड़ते हैं।

या हर OpenAI SDK के लिए एक बार सेट कर दें
export OPENAI_BASE_URL="https://unbottled.ai/api/hi-IN/v1"
export OPENAI_API_KEY="sk-unb-YOUR_KEY"
3
रिक्वेस्ट भेजें

टर्मिनल में पेस्ट करें, अपनी key डालें, चलाएँ। Python और JavaScript में भी वही कॉल।

curl https://unbottled.ai/api/hi-IN/v1/chat/completions \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "messages": [
      { "role": "system", "content": "You answer in one sentence." },
      { "role": "user", "content": "Why is the sky blue?" }
    ]
  }'
उदाहरण रिस्पॉन्स
200
{
  "id": "chatcmpl-3f9c1a...",
  "object": "chat.completion",
  "created": 1767225600,
  "model": "kimi-k3.1-pro",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Air scatters blue light more than red." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 31,
    "prompt_tokens_details": {"cached_tokens": 16, "cache_write_tokens": 0},
    "completion_tokens": 9,
    "total_tokens": 40,
    "credits_charged": 0.1
  }
}

एक्सेस और कीमत

API उन्हीं क्रेडिट पर चलता है जिन पर चैट ऐप। कोई अलग API प्लान नहीं, कोई सीट फ़ीस नहीं।

यह कैसे अनलॉक होता है
कोई भी प्लान, $8 प्रति महीने से। हर प्लान में हर महीने क्रेडिट मिलते हैं।
हमारी टीम के दिए क्रेडिट, जैसे टेस्टर क्रेडिट।
फ़्री क्रेडिट से यह कभी अनलॉक नहीं होता: हर महीने की फ़्री लिमिट, साइन अप और न्यूज़लेटर बोनस, रेफ़रल कमाई।

और चाहिए? सब्सक्राइबर $5 से शुरू होने वाले क्रेडिट पैक से टॉप अप करते हैं। पैक क्रेडिट कभी एक्सपायर नहीं होते।

बिना खरीदारी के

जिन अकाउंट में कोई खरीदारी नहीं हुई, वे key नहीं बना सकते, और हर /v1 कॉल HTTP 402 paid_plan_required लौटाती है।

ऑथेंटिकेशन

हर रिक्वेस्ट पर अपनी key Bearer टोकन की तरह भेजें। Keys sk-unb- से शुरू होती हैं। Anthropic क्लाइंट इसे x-api-key में भेजते हैं, वह भी चलता है।

Authorization: Bearer sk-unb-YOUR_KEY

हम key नहीं, उसका hash सेव करते हैं। key खो जाए तो नई बना लें।

Key सिर्फ़ API पर चलती है: /v1/models, चैट (/v1/chat/completions, /v1/responses, /v1/messages) और मीडिया (/v1/images, /v1/audio, /v1/videos, /v1/music, /v1/media)। यह आपके अकाउंट, पेमेंट या सेटिंग्स को छू नहीं सकती।

हर अकाउंट पर ज़्यादा से ज़्यादा 20 एक्टिव keys। कोई भी key कभी भी रद्द करें: वह तुरंत काम करना बंद कर देती है।

Key न हो या रद्द की गई key हो तो 401 मिलता है। बिना खरीदारी वाले अकाउंट की key पर 402 मिलता है।

चैट

Chat completions

POST/v1/chat/completions

स्टैंडर्ड OpenAI chat completions। मैसेज अंदर, एक assistant मैसेज बाहर। टेक्स्ट और इमेज input (image_url https URL या base64 data URL के रूप में)।

बिना स्ट्रीमिंग

डिफ़ॉल्ट यही है। मॉडल का काम पूरा होने पर आपको एक JSON body मिलती है। usage.credits_charged बताता है कि इस कॉल की कीमत कितनी रही।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/chat/completions \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "messages": [
      { "role": "system", "content": "You answer in one sentence." },
      { "role": "user", "content": "Why is the sky blue?" }
    ]
  }'
उदाहरण रिस्पॉन्स
200
{
  "id": "chatcmpl-3f9c1a...",
  "object": "chat.completion",
  "created": 1767225600,
  "model": "kimi-k3.1-pro",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Air scatters blue light more than red." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 31,
    "prompt_tokens_details": {"cached_tokens": 16, "cache_write_tokens": 0},
    "completion_tokens": 9,
    "total_tokens": 40,
    "credits_charged": 0.1
  }
}

स्ट्रीमिंग

OpenAI chunk फ़ॉर्मेट में server-sent events के लिए stream: true सेट करें, आखिर में data: [DONE] आता है। टोकन गिनती और credits_charged वाला आखिरी chunk पाने के लिए stream_options.include_usage जोड़ें। कनेक्शन बंद करते ही जनरेशन रुक जाता है। आप सिर्फ़ उतने का पेमेंट करते हैं जितना चला।

रिक्वेस्ट
curl -N https://unbottled.ai/api/hi-IN/v1/chat/completions \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "stream": true,
    "stream_options": { "include_usage": true },
    "messages": [{ "role": "user", "content": "Count to three." }]
  }'
उदाहरण स्ट्रीम
200
data: {"id":"chatcmpl-3f9c...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-3f9c...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"One, "},"finish_reason":null}]}

data: {"id":"chatcmpl-3f9c...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: {"id":"chatcmpl-3f9c...","object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":7,"total_tokens":19,"credits_charged":0.1}}

data: [DONE]

रिक्वेस्ट फ़ील्ड

model
ज़रूरी। GET /v1/models से एक मॉडल id।
messages
ज़रूरी। system, developer, user, assistant और tool मैसेज। User content एक string या टेक्स्ट और image_url पार्ट्स हो सकता है।
stream
server-sent events के लिए true। डिफ़ॉल्ट false।
stream_options
{ include_usage: true } एक आखिरी usage chunk जोड़ता है।
max_tokens
जनरेट होने वाले टोकन की ऊपरी सीमा। max_completion_tokens को प्राथमिकता मिलती है। ज़्यादा से ज़्यादा 32768।
temperature
0 से 2। जो मॉडल इसे सपोर्ट नहीं करते, वे इसे अनदेखा करते हैं।
top_p
0 से 1।
stop
एक stop string या उनकी लिस्ट।
n
सिर्फ़ 1 सपोर्टेड है। बाकी वैल्यू पर 400 मिलता है।
tools
फ़ंक्शन टूल जिन्हें मॉडल कॉल कर सकता है। टूल कॉलिंग देखें।
tool_choice
none, auto, required, या एक नाम वाला फ़ंक्शन।

टूल कॉलिंग

फ़ंक्शन कॉलिंग OpenAI की तरह काम करती है। आप फ़ंक्शन बताते हैं, मॉडल तय करता है कि किसे कॉल करना है, आप उसे चलाते हैं और रिज़ल्ट वापस भेजते हैं। हम आपके टूल कभी नहीं चलाते।

लूप

अपने मैसेज के साथ tools भेजें।

मॉडल tool_calls और finish_reason: tool_calls के साथ जवाब देता है। हर कॉल में एक id, फ़ंक्शन का नाम और JSON-string arguments होते हैं।

फ़ंक्शन खुद चलाएँ। assistant मैसेज जोड़ें, फिर हर कॉल के लिए उसके tool_call_id के साथ एक tool मैसेज।

फिर से कॉल करें। मॉडल रिज़ल्ट इस्तेमाल करके जवाब देता है।

1. tools के साथ रिक्वेस्ट

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/chat/completions \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "messages": [{ "role": "user", "content": "Weather in Berlin?" }],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Current weather for a city",
        "parameters": {
          "type": "object",
          "properties": { "city": { "type": "string" } },
          "required": ["city"]
        }
      }
    }],
    "tool_choice": "auto"
  }'

2. मॉडल एक कॉल मांगता है

200
{
  "object": "chat.completion",
  "model": "kimi-k3.1-pro",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "tool_calls": [
          {
            "id": "call_8x2k",
            "type": "function",
            "function": { "name": "get_weather", "arguments": "{\"city\":\"Berlin\"}" }
          }
        ]
      },
      "finish_reason": "tool_calls"
    }
  ]
}

3. रिज़ल्ट लौटाएँ

रिक्वेस्ट
# Run get_weather yourself, then send the result back:
curl https://unbottled.ai/api/hi-IN/v1/chat/completions \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "messages": [
      { "role": "user", "content": "Weather in Berlin?" },
      { "role": "assistant", "content": null, "tool_calls": [
        { "id": "call_8x2k", "type": "function",
          "function": { "name": "get_weather", "arguments": "{\"city\":\"Berlin\"}" } }
      ]},
      { "role": "tool", "tool_call_id": "call_8x2k", "content": "18C, cloudy" }
    ],
    "tools": [ ...same tools as before... ]
  }'

स्ट्रीमिंग टूल कॉल

stream: true के साथ, कॉल delta.tool_calls chunks में index के हिसाब से आती हैं। किसी index का पहला chunk id और function.name लाता है। बाद के chunks function.arguments में जुड़ते जाते हैं। उन्हें जोड़ें, फिर finish_reason के tool_calls होने पर JSON पार्स करें। हर OpenAI SDK यह आपके लिए करता है।

नियम

मॉडल को tools सपोर्ट करने चाहिए: GET /v1/models में supports_tools देखें। बाकी पर 400 tools_not_supported मिलता है।

tool_choice के none, auto और required OpenAI की तरह काम करते हैं। tools में न मौजूद फ़ंक्शन का नाम देने पर 400 मिलता है।

फ़ंक्शन के नाम: अक्षर, अंक, underscore, dash, ज़्यादा से ज़्यादा 64 कैरेक्टर।

टूल की परिभाषाएँ और टूल रिज़ल्ट input टोकन हैं। कॉल output टोकन हैं। इनकी बिलिंग बाकी टोकन की तरह ही होती है।

Responses API

POST/v1/responses

OpenAI Responses API, वह फ़ॉर्मेट जो Codex CLI बोलता है। chat completions वाले ही मॉडल, key, क्रेडिट और रेट लिमिट।

रिक्वेस्ट

input एक string या input items की लिस्ट है। instructions सिस्टम प्रॉम्प्ट है। जवाब output items के रूप में आता है। हर OpenAI SDK आपको output_text भी देता है।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/responses \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "instructions": "You answer in one sentence.",
    "input": "Why is the sky blue?"
  }'
उदाहरण रिस्पॉन्स
200
{
  "id": "resp_7d2e...",
  "object": "response",
  "status": "completed",
  "model": "kimi-k3.1-pro",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        { "type": "output_text", "text": "Air scatters blue light more than red." }
      ]
    }
  ],
  "usage": { "input_tokens": 24, "output_tokens": 9, "total_tokens": 33 }
}

स्ट्रीमिंग

Responses event stream के लिए stream: true सेट करें: response.created, टेक्स्ट deltas, फिर usage के साथ response.completed।

उदाहरण स्ट्रीम
200
event: response.created
data: {"type":"response.created","response":{"id":"resp_7d2e...","status":"in_progress"}}

event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Air scatters "}

event: response.completed
data: {"type":"response.completed","response":{"id":"resp_7d2e...","status":"completed"}}

Tools: function, custom और local_shell। मॉडल की कॉल output items के रूप में लौटती हैं। हर रिज़ल्ट को उसी call_id के साथ function_call_output item के रूप में वापस भेजें।

Reasoning मॉडल जवाब के साथ reasoning items भी लौटाते हैं।

बिलिंग, मॉडल ids, एरर और रेट लिमिट बिल्कुल chat completions की तरह काम करते हैं।

Messages API

POST/v1/messages
POST/v1/messages/count_tokens

Anthropic Messages API, वह फ़ॉर्मेट जो Claude Code और Anthropic SDK बोलते हैं। base URL बिना /v1 के इस्तेमाल करें: क्लाइंट /v1/messages खुद जोड़ते हैं।

रिक्वेस्ट

स्टैंडर्ड Messages रिक्वेस्ट: model, max_tokens, system, messages। टेक्स्ट और इमेज blocks अंदर, टेक्स्ट और tool_use blocks बाहर।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/messages \
  -H "x-api-key: sk-unb-YOUR_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "max_tokens": 1024,
    "system": "You answer in one sentence.",
    "messages": [{ "role": "user", "content": "Why is the sky blue?" }]
  }'
उदाहरण रिस्पॉन्स
200
{
  "id": "msg_01Hk...",
  "type": "message",
  "role": "assistant",
  "model": "kimi-k3.1-pro",
  "content": [{ "type": "text", "text": "Air scatters blue light more than red." }],
  "stop_reason": "end_turn",
  "usage": { "input_tokens": 24, "output_tokens": 9 }
}

स्ट्रीमिंग

Anthropic server-sent events के लिए stream: true सेट करें, message_start से message_stop तक।

उदाहरण स्ट्रीम
200
event: message_start
data: {"type":"message_start","message":{"id":"msg_01Hk...","role":"assistant","content":[]}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Air scatters "}}

event: message_stop
data: {"type":"message_stop"}

टोकन गिनें

POST /v1/messages/count_tokens मॉडल चलाए बिना किसी Messages रिक्वेस्ट के input टोकन गिनता है। Claude Code अपना context संभालने के लिए इसे कॉल करता है।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/messages/count_tokens \
  -H "x-api-key: sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5-20250929",
    "messages": [{ "role": "user", "content": "Why is the sky blue?" }]
  }'
उदाहरण रिस्पॉन्स
200
{ "input_tokens": 14 }

Auth: x-api-key या Authorization: Bearer। दोनों आपकी sk-unb key लेते हैं।

Model: GET /v1/models से कोई भी id। Claude Code जो Anthropic ids डिफ़ॉल्ट रूप से भेजता है, जैसे claude-sonnet-4-5-20250929, वे हमारे मिलते-जुलते Claude मॉडल पर जाती हैं।

Tools: tool_use blocks बाहर, tool_result blocks वापस, Anthropic API की तरह।

बाकी हर endpoint जैसे ही क्रेडिट, वही कीमत, वही रेट लिमिट।

मीडिया

इमेज

POST/v1/images/generations
POST/v1/images/edits

OpenAI images फ़ॉर्मेट। GET /v1/models से modality image वाला कोई भी मॉडल। हर OpenAI SDK के images क्लाइंट के साथ चलता है।

जनरेट करें

इन फ़ील्ड के साथ JSON भेजें। जवाब में हर इमेज का एक url आता है।

modelstring
ज़रूरी। GET /v1/models से modality image वाली कोई भी id।
promptstring
ज़रूरी। क्या बनाना है, ज़्यादा से ज़्यादा 2000 कैरेक्टर।
ninteger
हर कॉल में इमेज, 1 से 4। हर इमेज बिल होती है।
sizestring
WIDTHxHEIGHT जैसे 1024x1024, या auto। मॉडल जो साइज़ बनाता है, उसमें सबसे करीबी हम चुनते हैं।
aspect_ratiostring
हमारा एक्सटेंशन: 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 3:2 | 2:3 | 21:9। size पर भारी पड़ता है।
qualitystring
standard | hd | low | medium | high | auto। जहाँ मॉडल में detailed tier है, वहाँ hd और high उसे मांगते हैं।
response_formatstring
url (डिफ़ॉल्ट, 7 दिन चलने वाला साइन किया हुआ लिंक) या b64_json।
रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/images/generations \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-3-klein",
    "prompt": "A lighthouse on a cliff at dawn, oil painting",
    "size": "1024x1024",
    "n": 1
  }'
उदाहरण रिस्पॉन्स
200
{
  "created": 1767225600,
  "model": "flux-3-klein",
  "data": [
    { "url": "https://unbottled.ai/api/hi-IN/v1/media/3f9c.../image-1.png?expires=1767830400&sig=..." }
  ],
  "credits_charged": 1.17
}

इमेज एडिट करें

एक input इमेज और एक प्रॉम्प्ट। इसे multipart फ़ील्ड image के रूप में अपलोड करें, या JSON में image_url (https या base64 data URL) भेजें। मॉडल को इमेज input लेना चाहिए: input_modalities में image हो। Masks सपोर्टेड नहीं हैं; बदलाव प्रॉम्प्ट में बताएँ।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/images/edits \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -F model=flux-3-klein \
  -F prompt="Make it night, add a full moon" \
  -F image=@lighthouse.png

मॉडल जो साइज़ और ratio बनाता है, उसमें सबसे करीबी हम चुनते हैं।

url सेव की गई फ़ाइल का साइन किया हुआ लिंक है, बिना key के 7 दिन चलता है। b64_json bytes सीधे लौटाता है।

प्रति इमेज बिल होता है। रिस्पॉन्स में credits_charged बताता है कि कॉल की कीमत कितनी रही।

टेक्स्ट से वॉइस

POST/v1/audio/speech

टेक्स्ट अंदर, ऑडियो bytes बाहर। model GET /v1/models से एक वॉइस id है (modality speech), जैसे openai-nova। OpenAI स्टाइल भी चलता है: model tts-1 और voice nova।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/audio/speech \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai-nova",
    "input": "Your build finished. All tests are green.",
    "response_format": "mp3"
  }' \
  -o speech.mp3

input ज़्यादा से ज़्यादा 4096 कैरेक्टर। OpenAI, NanoGPT और ElevenLabs वॉइस पर speed 0.25 से 4।

response_format mp3 (डिफ़ॉल्ट), opus, aac, flac, wav या pcm। कौन से फ़ॉर्मेट मिलेंगे, यह वॉइस के प्रोवाइडर पर निर्भर है; बाकी पर लिस्ट के साथ 400 मिलता है।

प्रति कैरेक्टर बिल होता है। X-Credits-Charged हेडर बताता है कि कॉल की कीमत कितनी रही।

ट्रांसक्रिप्शन

POST/v1/audio/transcriptions
POST/v1/audio/translations

वॉइस से टेक्स्ट, OpenAI Whisper फ़ॉर्मेट। Multipart अपलोड, वही SDK कॉल जो आप पहले से इस्तेमाल करते हैं।

ट्रांसक्राइब करें

file ज़्यादा से ज़्यादा 25 MB (mp3, mp4, m4a, wav, webm, ogg, flac), model जैसे whisper-1, language वैकल्पिक। response_format json, text, srt, verbose_json या vtt।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -F model=whisper-1 \
  -F file=@meeting.mp3 \
  -F response_format=json
उदाहरण रिस्पॉन्स
200
{ "text": "Let's ship the release on Friday." }

अंग्रेज़ी में ट्रांसलेट करें

POST /v1/audio/translations: कोई भी बोली गई भाषा अंदर, अंग्रेज़ी टेक्स्ट बाहर। whisper-1 पर चलता है। transcriptions वाले ही फ़ॉर्मेट।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/audio/translations \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -F model=whisper-1 \
  -F file=@interview-de.mp3

प्रति सेकंड ऑडियो बिल होता है।

वीडियो

POST/v1/videos
GET/v1/videos/{id}
GET/v1/videos/{id}/content

Async, OpenAI के video API के ढाँचे में। कॉल तुरंत एक जॉब के साथ जवाब देती है। उसे poll करें, फिर MP4 डाउनलोड करें।

जॉब शुरू करें

model, prompt, seconds, size या aspect_ratio, resolution, negative_prompt। जवाब status queued वाला एक video ऑब्जेक्ट है।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/videos \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan-2-7-t2v",
    "prompt": "A paper boat drifting down a rainy street, cinematic",
    "seconds": 5,
    "size": "1280x720"
  }'
पूरा हुआ जॉब ऑब्जेक्ट
200
{
  "id": "video_8f2c0e5a7b1d4c3e9a6f0b2d4e6a8c1f",
  "object": "video",
  "model": "wan-2-7-t2v",
  "status": "completed",
  "progress": 100,
  "seconds": "5",
  "size": "1280x720",
  "url": "https://unbottled.ai/api/hi-IN/v1/media/<threadId>/video.mp4?expires=1767830400&sig=<signature>",
  "credits_charged": 42,
  "error": null
}

Poll और डाउनलोड

GET /v1/videos/{id} status (queued, in_progress, completed, failed), progress और पूरा होने पर एक साइन किया हुआ url लौटाता है। Polling फ़्री है और abuse लिमिट से बाहर है। GET /v1/videos/{id}/content MP4 स्ट्रीम करता है।

रिक्वेस्ट
# Poll until status is completed or failed (free, skipped by abuse guard)
curl https://unbottled.ai/api/hi-IN/v1/videos/video_8f2c0e5a7b1d4c3e9a6f0b2d4e6a8c1f \
  -H "Authorization: Bearer sk-unb-YOUR_KEY"

# Download the MP4
curl https://unbottled.ai/api/hi-IN/v1/videos/video_8f2c0e5a7b1d4c3e9a6f0b2d4e6a8c1f/content \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -o boat.mp4

इमेज से वीडियो: JSON में image_url या multipart अपलोड में input_reference भेजें। यह पहला फ़्रेम बनता है।

वीडियो तैयार होने पर, प्रति सेकंड वीडियो बिल होता है। credits_charged कीमत दिखाता है।

फ़ेल हुए जॉब का कोई पैसा नहीं लगता। error वजह बताता है।

म्यूज़िक

POST/v1/music
GET/v1/music/{id}
GET/v1/music/{id}/content

वीडियो की तरह async। जॉब शुरू करें, GET /v1/music/{id} poll करें, GET /v1/music/{id}/content डाउनलोड करें।

जॉब शुरू करें

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/music \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "musicgen-stereo",
    "prompt": "Lo-fi hip hop, warm piano, slow vinyl crackle",
    "seconds": 20
  }'

Poll और डाउनलोड

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/music/music_3b7d1f9a2c4e6a8b0d2f4a6c8e0b1d3f \
  -H "Authorization: Bearer sk-unb-YOUR_KEY"

curl https://unbottled.ai/api/hi-IN/v1/music/music_3b7d1f9a2c4e6a8b0d2f4a6c8e0b1d3f/content \
  -H "Authorization: Bearer sk-unb-YOUR_KEY" \
  -o track.mp3

seconds: लगभग 8, 20 या 30। मॉडल इसे राउंड कर सकता है। स्टाइल, मूड, इंस्ट्रूमेंट और टेम्पो prompt में बताएँ।

क्लिप तैयार होने पर प्रति क्लिप बिल होता है। फ़ेल हुए जॉब का कोई पैसा नहीं लगता।

मीडिया फ़ाइलें

GET/v1/media/{folder}/{file}

मीडिया रिस्पॉन्स का हर url यहीं पॉइंट करता है। साइन किया हुआ लिंक बिना key के 7 दिन चलता है, तो आप इसे ब्राउज़र या किसी यूज़र को दे सकते हैं। आपकी API key के साथ वही पाथ कभी भी चलता है।

रिक्वेस्ट
# Signed link from a response: works without a key for 7 days
curl -o image.png "https://unbottled.ai/api/hi-IN/v1/media/3f9c.../image-1.png?expires=1767830400&sig=..."

# Same file with your key, any time
curl -o image.png https://unbottled.ai/api/hi-IN/v1/media/3f9c.../image-1.png \
  -H "Authorization: Bearer sk-unb-YOUR_KEY"
रेफ़रेंस

मॉडल

GET/v1/models

GET /v1/models वे मॉडल दिखाता है जिन्हें आपकी key अभी कॉल कर सकती है, साथ में context साइज़, टूल सपोर्ट और प्रति मिलियन टोकन क्रेडिट कीमत। रिक्वेस्ट में model फ़ील्ड के लिए id इस्तेमाल करें।

रिक्वेस्ट
curl https://unbottled.ai/api/hi-IN/v1/models \
  -H "Authorization: Bearer sk-unb-YOUR_KEY"
उदाहरण रिस्पॉन्स
200
{
  "object": "list",
  "data": [
    {
      "id": "kimi-k3.1-pro",
      "object": "model",
      "created": 1735689600,
      "owned_by": "moonshot",
      "name": "Kimi K3.1 Pro",
      "context_length": 131072,
      "supports_tools": true,
      "input_modalities": ["text"],
      "output_modalities": ["text"],
      "pricing": {
        "input_credits_per_million_tokens": 31.239000000000004,
        "output_credits_per_million_tokens": 1092.299,
        "cache_read_credits_per_million_tokens": 26,
        "cache_write_credits_per_million_tokens": null,
        "cache_write_1h_credits_per_million_tokens": null
      }
    }
  ]
}

लिस्ट आपके अकाउंट पर निर्भर है। अनजान या अनुपलब्ध ids पर 404 model_not_found मिलता है। एक ही मैपिंग है: /v1/messages पर, Claude Code जो Claude ids डिफ़ॉल्ट रूप से भेजता है, वे उसी फ़ैमिली के हमारे सबसे नए Claude पर जाती हैं।

चैट टोकन की कीमत

pricing एक्सटेंशन base context tier पर प्रति मिलियन टोकन ग्राहक क्रेडिट दिखाता है, markup सहित। इस ऑब्जेक्ट का कोई भी फ़ील्ड USD में नहीं है। null वैल्यू का मतलब है कि अलग रेट नहीं दिया गया।

input_credits_per_million_tokens
बिना cache वाला input।
output_credits_per_million_tokens
जनरेट हुआ टेक्स्ट output।
cache_read_credits_per_million_tokens
प्रॉम्प्ट cache से पढ़ा गया input।
cache_write_credits_per_million_tokens
डिफ़ॉल्ट lifetime पर प्रॉम्प्ट cache में लिखा गया input।
cache_write_1h_credits_per_million_tokens
एक घंटे की cache lifetime के साथ लिखा गया input।

जब pricing.tiers मौजूद हो, तो मैच करने वाले tier में वही क्रेडिट फ़ील्ड इस्तेमाल करें। min_prompt_tokens में threshold शामिल है। utc_start और utc_end HHMM फ़ॉर्मेट में UTC समय हैं, start शामिल और end शामिल नहीं।

उसी लिस्ट में मीडिया मॉडल

इमेज, वीडियो, म्यूज़िक, वॉइस और ट्रांसक्रिप्शन मॉडल उसी लिस्ट में हैं। हर एंट्री बताती है कि वह क्या करती है और उसे कहाँ कॉल करना है।

मीडिया एंट्री
{
  "id": "flux-3-klein",
  "object": "model",
  "owned_by": "blackForestLabs",
  "modality": "image",
  "endpoints": ["/v1/images/generations", "/v1/images/edits"],
  "input_modalities": ["text", "image"],
  "output_modalities": ["image"],
  "pricing": { "credits_per_image": 1.17 }
}

modality है chat, image, video, music, speech या transcription। endpoints उन पाथ की लिस्ट है जो वह मॉडल लेते हैं।

मीडिया की कीमत प्रति यूनिट है: credits_per_image, credits_per_second (वीडियो), credits_per_clip (म्यूज़िक), credits_per_1k_characters (वॉइस), credits_per_minute (ट्रांसक्रिप्शन)।

Anthropic क्लाइंट (anthropic-version हेडर) को सिर्फ़ चैट मॉडल मिलते हैं। जिन मॉडल का प्रोवाइडर हमारी तरफ़ सेट नहीं है, वे लिस्ट में नहीं आते और 404 model_not_found लौटाते हैं।

कीमत और फ़िल्टर के साथ हर मॉडल देखें

क्रेडिट और बिलिंग

API उन्हीं क्रेडिट से चलता है जिनसे चैट ऐप, और बिलिंग के नियम भी वही हैं। एक बैलेंस, एक बिल।

लिस्टेड कीमत का अंदाज़ा लगाने के लिए हर टोकन गिनती को उसके प्रति मिलियन क्रेडिट रेट से गुणा करें। हर input टोकन को एक बार गिनें: uncached, read या written।

हर रिस्पॉन्स usage.credits_charged बताता है। आपका बैलेंस ऐप में क्रेडिट सेक्शन में है।

कॉल चलने से पहले हम सबसे ज़्यादा संभावित खर्च के हिसाब से आपका बैलेंस चेक करते हैं। कम पड़े तो HTTP 402 insufficient_credits, कुछ नहीं चलता, कुछ चार्ज नहीं होता।

जब प्रोवाइडर चार्ज बताता है, तो बिलिंग उस चार्ज और markup से होती है। वरना लागू टोकन रेट से। आखिरी राउंड किया हुआ चार्ज usage.credits_charged में है।

मीडिया कॉल की बिलिंग भी ऐसे ही होती है: जहाँ प्रोवाइडर बताता है वहाँ असली लागत और हमारा markup, वरना मॉडल की लिस्टेड कीमत। इमेज प्रति इमेज, वॉइस प्रति कैरेक्टर, ट्रांसक्रिप्शन प्रति सेकंड ऑडियो, वीडियो क्लिप तैयार होने पर, म्यूज़िक प्रति क्लिप।

क्रेडिट खत्म? पैक से टॉप अप करें, प्लान रिन्यू या अपग्रेड करें। अगली कॉल तुरंत चलेगी।

402
HTTP/1.1 402 Payment Required
{
  "error": {
    "message": "Insufficient credits. This call needs about 1.2, you have 0.4. Top up to continue.",
    "type": "insufficient_quota",
    "param": null,
    "code": "insufficient_credits"
  }
}

एरर और रेट लिमिट

एरर OpenAI वाले ढाँचे में आते हैं, इसलिए SDK अपनी सामान्य exceptions देते हैं। मैसेज पर नहीं, error.code पर ब्रांच करें।

एरर body

{
  "error": {
    "message": "Invalid or revoked API key. ...",
    "type": "authentication_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

एरर कोड

401missing_api_key
कोई key नहीं भेजी गई। Authorization: Bearer sk-unb-... या x-api-key भेजें।
401invalid_api_key
Key गलत है या रद्द हो चुकी है।
402paid_plan_required
अकाउंट पर अभी कोई खरीदारी नहीं हुई। कोई भी प्लान इसे अनलॉक करता है।
402insufficient_credits
इस कॉल के लिए बैलेंस कम है। टॉप अप करें।
402free_tier_cap_reached
पेड बैलेंस खाली है और आज की फ़्री क्रेडिट सीमा पूरी हो चुकी है। टॉप अप करें।
404model_not_found
मॉडल मौजूद नहीं है या आपके लिए उपलब्ध नहीं है।
400invalid_value / unsupported_parameter / tools_not_supported
गलत रिक्वेस्ट: अनसपोर्टेड पैरामीटर, गलत tool_choice, गलत इमेज URL।
400content_policy_violation
मीडिया प्रोवाइडर ने प्रॉम्प्ट मना कर दिया। कुछ चार्ज नहीं हुआ। प्रॉम्प्ट बदलें या दूसरा मॉडल चुनें।
403uncensored_consent_required
अनसेंसर्ड मॉडल के लिए आपके अकाउंट पर एक बार 18+ कन्फ़र्मेशन चाहिए। API keys पेज पर एक बार कन्फ़र्म करें, फिर दोबारा कोशिश करें।
429rate_limit_exceeded
Abuse सुरक्षा चालू हुई (burst या एक साथ कई स्ट्रीम) या ऊपर के प्रोवाइडर से 429। Retry-After पढ़ें और फिर कोशिश करें।
502upstream_error
मॉडल प्रोवाइडर फ़ेल हुआ। फिर से कोशिश करना सुरक्षित है। स्ट्रीम एक error event के साथ खत्म होती हैं।
503balance_unavailable
हम आपका बैलेंस नहीं पढ़ पाए, इसलिए कुछ नहीं चला। फिर कोशिश करें।
स्ट्रीम के बीच में होने वाले एरर उसी error ऑब्जेक्ट के साथ एक data: event के रूप में आते हैं, उसके बाद data: [DONE]।

रेट लिमिट

पेमेंट करने वाले अकाउंट पर कोई फ़िक्स्ड रेट लिमिट नहीं। हर रिक्वेस्ट आपके क्रेडिट से बिल होती है, और क्रेडिट खत्म होने पर कॉल HTTP 402 के साथ रुक जाती हैं। खुली छूट वाली abuse सुरक्षा लागू है (ऊँची burst सीमा और एक साथ चलने वाली स्ट्रीम की सीमा), ताकि बेकाबू लूप सर्विस को ओवरलोड न कर सकें। ऊपर के प्रोवाइडर के 429 उनके Retry-After हेडर के साथ आगे आते हैं। HTTP 429 मिले तो Retry-After सेकंड रुकें और फिर कोशिश करें।

429
HTTP/1.1 429 Too Many Requests
Retry-After: 12
{ "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", ... } }
इंटीग्रेशन

कोडिंग टूल

एक base URL, एक key। Codex CLI और Claude Code सीधे कनेक्ट होते हैं। OpenCode, Continue, Aider और Cline chat completions इस्तेमाल करते हैं। अपना टूल चुनें, ब्लॉक कॉपी करें, चलाएँ।

Paste the command and Codex runs on unbottled.ai. To keep it, append the block to ~/.codex/config.toml and start Codex with --profile unbottled.

One command
UNBOTTLED_API_KEY="sk-unb-YOUR_KEY" codex \
  -c 'model_providers.unbottled.name="unbottled.ai"' \
  -c 'model_providers.unbottled.base_url="https://unbottled.ai/api/hi-IN/v1"' \
  -c 'model_providers.unbottled.env_key="UNBOTTLED_API_KEY"' \
  -c 'model_providers.unbottled.wire_api="responses"' \
  -c model_provider=unbottled \
  -m glm-5.3
Permanent setup
[model_providers.unbottled]
name = "unbottled.ai"
base_url = "https://unbottled.ai/api/hi-IN/v1"
env_key = "UNBOTTLED_API_KEY"
wire_api = "responses"

[profiles.unbottled]
model_provider = "unbottled"
model = "glm-5.3"
Then start it
export UNBOTTLED_API_KEY="sk-unb-YOUR_KEY"
codex --profile unbottled
Tested with Codex CLI 0.118.0
Swap glm-5.3 for any id from GET /v1/models, like kimi-k3.1-pro, kimi-k3, uncensored-lm-v1.2. API keys पेज पर यही ब्लॉक आपकी key भरी हुई हालत में दिखते हैं।

SDK उदाहरण

आधिकारिक OpenAI और Anthropic SDK बिना बदलाव के चलते हैं। base URL और key सेट करें, बाकी कोड वैसा ही रखें।

चैट

from openai import OpenAI

client = OpenAI(
    base_url="https://unbottled.ai/api/hi-IN/v1",
    api_key="sk-unb-YOUR_KEY",
)

reply = client.chat.completions.create(
    model="kimi-k3.1-pro",
    messages=[{"role": "user", "content": "Why is the sky blue?"}],
)
print(reply.choices[0].message.content)

स्ट्रीमिंग

stream = client.chat.completions.create(
    model="kimi-k3.1-pro",
    messages=[{"role": "user", "content": "Count to three."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Responses API

reply = client.responses.create(
    model="kimi-k3.1-pro",
    input="Why is the sky blue?",
)
print(reply.output_text)

Anthropic SDK

import anthropic

client = anthropic.Anthropic(
    base_url="https://unbottled.ai/api/hi-IN",
    api_key="sk-unb-YOUR_KEY",
)

reply = client.messages.create(
    model="kimi-k3.1-pro",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Why is the sky blue?"}],
)
# Reasoning models put a thinking block first: print the text block.
print(next(block.text for block in reply.content if block.type == "text"))

इमेज

import base64

img = client.images.generate(
    model="flux-3-klein",
    prompt="A lighthouse on a cliff at dawn, oil painting",
    response_format="b64_json",
)
open("lighthouse.png", "wb").write(base64.b64decode(img.data[0].b64_json))

वॉइस

# OpenAI names work too: model tts-1 plus voice nova is openai-nova.
audio = client.audio.speech.create(
    model="tts-1", voice="nova", input="Your build finished."
)
audio.write_to_file("speech.mp3")

ट्रांसक्रिप्शन

with open("meeting.mp3", "rb") as f:
    result = client.audio.transcriptions.create(model="whisper-1", file=f)
print(result.text)

गाइड

लंबी गाइड: OpenAI या OpenRouter से स्विच करना, API पर अनसेंसर्ड मॉडल, और अपनी key को कोडिंग टूल से जोड़ना।

डेवलपर गाइड

एक API key, हर मॉडल। OpenAI और Anthropic फ़ॉर्मेट।

OpenAI chat completions, Responses API और Anthropic Messages एक ही endpoint पर। आपका SDK, Claude Code और Codex CLI हर मॉडल पर। खर्च कितना है, और कब सीधे प्रोवाइडर या OpenRouter बेहतर विकल्प है।

डेवलपर गाइड

अनसेंसर्ड LLM API। आपका SDK। इनकार की आदत नहीं।

OpenAI और Anthropic compatible endpoints पर abliterated और अनसेंसर्ड मॉडल। मॉडल id, कीमतें, चालू curl और Python उदाहरण, लिमिट और 18+ वाला स्टेप।

डेवलपर गाइड

एक key। हर मॉडल। Codex और Claude Code भी।

Codex CLI, Claude Code, OpenCode, Continue, Aider और Cline एक API key पर, अनसेंसर्ड मॉडल समेत। एक base URL, हर टूल के लिए एक कमांड, और वो अड़चनें जो हमें मिलीं।

डेवलपर गाइड

OpenRouter के विकल्प। एक key, कम इनकार।

OpenRouter के छह विकल्प, उन्हीं के docs से: API फ़ॉर्मेट, अनसेंसर्ड मॉडल, फ़ीस। साथ में वो दो लाइनें जो आपके OpenAI SDK क्लाइंट को शिफ़्ट करने पर बदलती हैं।

हर मॉडल पर बनाएँ।

Key बनाएँ, अपना SDK यहाँ पॉइंट करें, शिप करें।