Everything you need to integrate TamgaStudio into your applications.
TamgaStudio is a fully OpenAI-compatible API gateway. All endpoints follow the OpenAI format. Just change the base_url and your API key.
curl https://tamga.studio/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tamgastudio/gpt-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Base URL: https://tamga.studio/api/v1
All API requests require an API key passed as a Bearer token in the Authorization header.
Authorization: Bearer tl-sk-your-api-key-here
Generate API keys from the dashboard.
Generate text responses from any of the available AI models.
POST /api/v1/chat/completions{
"model": "tamgastudio/gpt-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is AI?"}
],
"temperature": 0.7,
"max_tokens": 1024,
"top_p": 1,
"stream": false
}
| Parameter | Type | Default | Description |
|---|---|---|---|
model | string | - | Model ID (e.g. tamgastudio/gpt-5) |
messages | array | - | Array of message objects with role and content |
temperature | number | 0.7 | Sampling temperature (0-2) |
max_tokens | integer | 1024 | Maximum tokens in response |
stream | boolean | false | Enable SSE streaming |
top_p | number | 1 | Nucleus sampling threshold |
stop | string/array | null | Stop sequences |
tools | array | null | Tool definitions for function calling |
seed | integer | null | Deterministic sampling seed |
Set stream: true for real-time SSE (Server-Sent Events) responses. Each chunk contains a delta of the generated content.
curl https://tamga.studio/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tamgastudio/gpt-5",
"messages": [{"role": "user", "content": "Tell me a story"}],
"stream": true
}'
Stream ends with data: [DONE].
Generate vector embeddings for text inputs. This endpoint is in development. Join the waitlist to get early access.
Generate images from text prompts. This endpoint is in development. Join the waitlist to get early access.
Re-rank documents by relevance to a query. This endpoint is in development. Join the waitlist to get early access.
250+ AI models available. All models are accessed through the same API endpoint with consistent pricing. View the complete model catalog on the Models page.
GET /api/v1/models
Example pricing: $0.05-$30.00 per 1M input tokens, $0.20-$75.00 per 1M output tokens - depending on model.
Use the official OpenAI Python library with TamgaStudio as the base URL.
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://tamga.studio/api/v1",
api_key="YOUR_API_KEY"
)
# Chat
response = client.chat.completions.create(
model="tamgastudio/gpt-5",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
# Streaming
stream = client.chat.completions.create(
model="tamgastudio/gpt-5",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
# Models list
models = client.models.list()
for m in models:
print(m.id)
const response = await fetch("https://tamga.studio/api/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "tamgastudio/gpt-5",
messages: [{role: "user", content: "Hello!"}],
stream: false
})
});
const data = await response.json();
console.log(data.choices[0].message.content);
# Chat
curl https://tamga.studio/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tamgastudio/gpt-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
# List models
curl https://tamga.studio/api/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
TamgaStudio uses a prepaid credit system. Here is how it works:
Check your balance via API:
curl https://tamga.studio/api/dashboard/billing \
-H "Cookie: tamgastudio_session=YOUR_SESSION"
| Limit | Value |
|---|---|
| Requests per minute | 20 |
| Response when exceeded | HTTP 429 + JSON error |
| Code | HTTP Status | Description |
|---|---|---|
invalid_api_key | 401 | Bad or expired API key |
insufficient_credits | 402 | Credit balance is $0 |
model_not_found | 404 | Unknown model ID |
rate_limit_exceeded | 429 | Too many requests |
missing_parameters | 400 | Required fields missing |