Pay as you go
Open API console in the Yntra web app: create keys, set a monthly spending limit per key and see your balance and usage. Pay-as-you-go keys need no subscription: every request is charged to your prepaid credit at these prices (USD; the balance is in euros at 1.08 USD per euro). When the credit is used up the API answers 402 insufficient_quota.
| Model id | Price | Best for |
|---|---|---|
yntra | $0.30 input · $1.20 output per 1M tokens | Fast and economical: chat, customer support, writing, simple code |
yntra-expert | $1.50 input · $3.00 output per 1M tokens | Reasoning, research, analysis, long documents |
yntra-max | $2.50 input · $12.50 output per 1M tokens | Our most capable model: legal, complex code, agents |
yntra-auto | Price of the model it picks | Picks the cheapest model that fits each request |
yntra-image | $0.006 per image | Fast images, drafts and illustrations |
yntra-image-pro | $0.04 per image | High-quality photorealistic images and edits |
yntra-image-max | $0.07 per image | Top quality |
| Video | $1.20 every 5 seconds | Videos with sound, 5 to 60 seconds |
| Web search | $0.005 per search | Answers with fresh sources |
The same credit pays the assistants you put on your website, Telegram and WhatsApp.
Base URL and authentication
Base URL: https://api.yntra.ai/v1. Every request needs an API key: pay-as-you-go keys from API console, plan keys from Settings → Yntra Code and API keys in the Yntra web app, sent as a bearer token:
Authorization: Bearer yntra_…
Keep keys out of source code and revoke a key from Settings as soon as you no longer need it.
Models
curl https://api.yntra.ai/v1/models \
-H "Authorization: Bearer $YNTRA_API_KEY"
| Model id | Plans | Notes |
|---|---|---|
yntra | Plus, Pro (plan keys) | Default. On Pro, requests that use tools and complex requests are routed to Yntra Agent automatically. |
yntra-agent | Pro | Asks for Yntra Agent explicitly, within the daily Yntra Agent allowance of the plan. |
Chat completions
curl https://api.yntra.ai/v1/chat/completions \
-H "Authorization: Bearer $YNTRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "yntra", "messages": [{"role": "user", "content": "Summarise the GDPR in three lines"}]}'
The request and response formats follow the standard chat completions format used by most AI tools and SDKs. Supported fields: model, messages, stream, stream_options, temperature, top_p, max_tokens / max_completion_tokens (up to 16,384), tools, tool_choice, parallel_tool_calls, stop, response_format, presence_penalty, frequency_penalty, seed, reasoning_effort. Other fields are ignored.
Streaming
Set "stream": true to receive server-sent events in the standard chat completions streaming format; the last chunk carries the token usage.
Images
curl https://api.yntra.ai/v1/images/generations \
-H "Authorization: Bearer $YNTRA_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "yntra-image-pro", "prompt": "A pizza margherita on a wooden table", "size": "1536x1024"}'
The response has the standard data[0].b64_json field with the PNG image.
Python example
import requests
r = requests.post("https://api.yntra.ai/v1/chat/completions",
headers={"Authorization": "Bearer yntra_…"},
json={"model": "yntra", "messages": [{"role": "user", "content": "Hello"}]})
print(r.json()["choices"][0]["message"]["content"])
Limits
| Limit | Value |
|---|---|
| Who can use the API | Every account with pay-as-you-go keys and credit; plan keys on Plus and Pro |
| Requests per day | Plus: 3,000 · Pro: no daily request limit |
| Requests per minute | 120 per account |
| Parallel requests | 4 per account |
| Request body | 4 MB |
Errors
Errors use the shape {"error": {"message", "type"}}: 401 invalid or revoked key, 402 credit used up or monthly key limit reached, 403 plan without API access, 429 rate or daily limit reached, 503 no model available for a moment (retry after a few seconds).