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/completions

Example 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

ParameterTypeDefaultDescription
modelstring–Model ID (e.g. tamgastudio/gpt-5)
messagesarray–Array of message objects with role and content
temperaturenumber0.7Sampling temperature (0-2)
max_tokensinteger1024Maximum tokens in response
streambooleanfalseEnable SSE streaming
top_pnumber1Nucleus sampling threshold
stopstring / arraynullStop sequences
toolsarraynullFunction calling definitions
seedintegernullDeterministic 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/models

Check 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

LimitValue
Requests per minute20
Response when exceededHTTP 429 + JSON error

Error Codes

CodeHTTP StatusDescription
invalid_api_key401Bad or expired API key
insufficient_credits402Credit balance is $0
model_not_found404Unknown model ID
rate_limit_exceeded429Too many requests
missing_parameters400Required fields missing