API keys
Separate keys for development and production; secure (masked) display and management from one table.
Developer API
Dozens of AI models from one endpoint — compatible with the OpenAI SDK, no VPN from Iran. API key, docs, usage stats and wallet top-up in the developer console. For the terminal: Claude CLI guide; for automation: n8n guide.
from openai import OpenAI
client = OpenAI(
base_url="https://api.chatqt.com/api/v1",
api_key="<CHATQT_API_KEY>",
)
completion = client.chat.completions.create(
model="openai/gpt-4.1",
messages=[
{"role": "user", "content": "What is the meaning of life?"},
],
)
print(completion.choices[0].message.content)
developer console
In the console.chatqt.com you create an API key, choose a model, read the docs, monitor usage and top up your wallet — with no need for a VPN from Iran.
Separate keys for development and production; secure (masked) display and management from one table.
A list of ChatGPT, Claude, Gemini, Grok and dozens of other models, each with a unique ID for API requests.
Quick start, Streaming, Tool Calls, multimodal, parameters and error handling — the same content as the console.
Request count, cost, models used, a weekly chart and a detailed history of every call.
Dollar balance, online top-up via the bank gateway, and billing based on actual usage.
For the terminal Claude CLI guide; for workflows in n8n n8n guide.
Quick start
ChatQT is a unified API for accessing dozens of AI models from one endpoint. With a few lines of code and an API key from the console, you can use any framework or SDK you like.
Create an account and top up your wallet.
Create a new key from the 'API keys' section.
Test with the OpenAI SDK or REST.
Compatible with the official OpenAI library — just change base_url and api_key :
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://api.chatqt.com/api/v1",
api_key="YOUR_CHATQT_API_KEY",
)
completion = client.chat.completions.create(
model="openai/gpt-4.1",
messages=[
{"role": "user", "content": "What is the meaning of life?"},
],
)
print(completion.choices[0].message.content)
In any language via HTTP — example with Python and requests:
import requests
url = "https://api.chatqt.com/api/v1/chat/completions"
headers = {
"Authorization": "Bearer YOUR_CHATQT_API_KEY",
"Content-Type": "application/json",
}
payload = {
"model": "openai/gpt-4.1",
"messages": [{"role": "user", "content": "Hello!"}],
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
print(response.json()["choices"][0]["message"]["content"])
Authentication
| Base URL | https://api.chatqt.com/api/v1 |
| Header | Authorization: Bearer YOUR_CHATQT_API_KEY |
| Format | JSON · compatible with OpenAI Chat Completions |
Keys with the prefix sk-or-v1- are shown in the console. Never commit a key to a public repository; use an environment variable.
Features
From conversation and streaming to image, video, audio and Tool Calls — all from one gateway. Details of each endpoint in console → Docs.
Multi-step Chat Completions, message history, and support for system / user / assistant.
Token-by-token responses with stream: true — ideal for chat interfaces.
Call functions and external tools with a standard interface across models.
Image, audio and file input in messages — depending on the selected model.
temperature, max_tokens, top_p and other model settings in the request body.
Text embedding, TTS, STT and image/video generation for supported models.
Streaming
To display the response progressively in the UI, enable the stream parameter. The official OpenAI SDK supports streaming.
stream = client.chat.completions.create(
model="openai/gpt-4.1",
messages=[{"role": "user", "content": "Write a short story"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
Tool Calls
Tool Calling lets the model suggest external tools. The model doesn't run the tool itself — you call the function and return the result to the conversation. ChatQT provides a uniform interface for all supported models.
{
"model": "openai/gpt-4o-mini",
"messages": [
{"role": "user", "content": "What are the titles of some books by James Joyce?"}
],
"tools": [
{
"type": "function",
"function": {
"name": "search_books",
"description": "Search books by author",
"parameters": {
"type": "object",
"properties": {
"author": {"type": "string"}
}
}
}
}
]
}
Models
In the field model use the unique ID from the console — usually in the form provider/model-name (e.g., openai/gpt-4.1, anthropic/claude-sonnet-4.6). The full list is in console → Models and in the price table.
Stats and reports
In the console, the 'Usage stats' section includes summary cards, a weekly usage chart and a request-history table (date, model, context tokens, cost).
Total requests
—
Total cost
$—
Models used
—
Average cost
$—
Billing
The API is based on pay-as-you-go . You can see your wallet balance in the console and top up via the bank gateway (online Rial payment). No mandatory subscription — you only pay for what you use.
Error handling
Invalid or expired API key. Create a new key from the console and check the Authorization header.
Insufficient wallet balance — top up from the Wallet section.
The model ID is wrong. Copy it exactly from the console's model list.
Too many requests — exponential backoff and delayed retry are recommended.
FAQ
/api/v1 . Some clients (such as Claude CLI) use /api without v1 — Claude CLI guide and n8n guide.Get an API key, send your first request and track usage in the console.