TamgaStudio API Reference
Access open-source and proprietary LLM models through a single API key. Fully compatible with OpenAI SDKs.
Quickstart
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://api.tamga.studio/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://api.tamga.studio/v1
Authentication
Include your API key in the Authorization header for every request.
Authorization: Bearer tl-sk-your-api-key-here
Chat Completions
Send messages and get a complete response in a single request.
POST /v1/chat/completionsExample Request Body
{
"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,
"stream": false
}
Parameters
| 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 | Function calling definitions |
seed | integer | null | Deterministic sampling seed |
Server-Sent Streams
Receive word-by-word responses using stream: true.
curl https://api.tamga.studio/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
}'
Each SSE chunk is data: {"choices":[...]} and the stream ends with data: [DONE].
Python SDK
Run pip install openai and change just your base URL.
from openai import OpenAI
client = OpenAI(
base_url = "https://api.tamga.studio/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
for m in client.models.list():
print(m.id)
Models
List every model available under your account.
GET /v1/modelsCheck the Pricing page for up-to-date per-model rates, context windows, and token costs.
Go to Pricing →Credits & Billing
You operate on a prepaid credit balance. Every API call is debited from your balance according to the model rate.
- 1 USD = 1 credit
- When balance reaches zero calls return
402 insufficient_credits - Use Dashboard → Top Up to reload credits
Rate Limits
| Limit | Value |
|---|---|
| Requests per minute | 20 |
| Response when exceeded | HTTP 429 + JSON error |
Error Codes
| 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 |