Developer API

The power of ChatQT, in developers' hands.

Dozens of AI models from one endpoint — compatible with the OpenAI SDK, transparent usage. API key, docs, usage stats and wallet top-up in the developer console. For the terminal: Claude CLI guide; for automation: n8n guide.

Python
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

Everything in one dashboard.

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 access from Iran.

API keys

Separate keys for development and production; secure (masked) display and management from one table.

Models

A list of ChatGPT, Claude, Gemini, Grok and dozens of other models, each with a unique ID for API requests.

Interactive docs

Quick start, Streaming, Tool Calls, multimodal, parameters and error handling — the same content as the console.

Usage statistics

Request count, cost, models used, a weekly chart and a detailed history of every call.

Wallet

Dollar balance, online top-up via the bank gateway, and billing based on actual usage.

Quick start

Getting started with ChatQT

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.

  1. 1

    Sign up in the console

    Create an account and top up your wallet.

  2. 2

    Create an API key

    Create a new key from the 'API keys' section.

  3. 3

    Your first request

    Test with the OpenAI SDK or REST.

Using the OpenAI SDK

Compatible with the official OpenAI library — just change base_url and api_key :

Python
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)

Using the API directly

In any language via HTTP — example with Python and requests:

Python
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 and API key

Base URLhttps://api.chatqt.com/api/v1
HeaderAuthorization: Bearer YOUR_CHATQT_API_KEY
FormatJSON · 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

One API, dozens of models.

From conversation and streaming to image, video, audio and Tool Calls — all from one gateway. Details of each endpoint in console → Docs.

chat/completions

Conversation

Multi-step Chat Completions, message history, and support for system / user / assistant.

Streaming

Token-by-token responses with stream: true — ideal for chat interfaces.

Tool Calls

Call functions and external tools with a standard interface across models.

Multimodal

Image, audio and file input in messages — depending on the selected model.

Parameters

temperature, max_tokens, top_p and other model settings in the request body.

Embeddings and more

Text embedding, TTS, STT and image/video generation for supported models.

Streaming

Streaming responses

To display the response progressively in the UI, enable the stream parameter. The official OpenAI SDK supports streaming.

Python
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 and function calling

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.

Step 1: request with tools
Step 2: run the tool
Step 3: send the result
JSON
{
 "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

Model ID

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.

Note: A model's display name (e.g., «Claude Opus 4.7») is not the same as its API ID — always copy it from the console.

Stats and reports

Usage statistics

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

Wallet and top-up

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 (pay as you go). No mandatory subscription — you only pay for what you use.

  • The balance is shown in dollars; checkout uses your selected payment method.
  • When credit runs out, API requests pause until you top up again.
  • Details of each model's rates are on the developer console.

Error handling

Common errors

401 Unauthorized

Invalid or expired API key. Create a new key from the console and check the Authorization header.

402 / Insufficient balance

Insufficient wallet balance — top up from the Wallet section.

404 Model not found

The model ID is wrong. Copy it exactly from the console's model list.

429 Rate limit

Too many requests — exponential backoff and delayed retry are recommended.

FAQ

Common developer questions

Is it compatible with the official OpenAI SDK?
Yes. Just set base_url to https://api.chatqt.com/api/v1 and api_key to your ChatQT key.
What's the difference between api.chatqt.com/api and /api/v1?
For the OpenAI SDK and n8n, use /api/v1. Some clients (such as Claude CLI) use /api without v1 — Claude CLI guide and n8n guide.
Where are the full docs?
The interactive, up-to-date version is in console → Docs. This page is an overview and quick start.

Ready to build with the API?

Get an API key, send your first request and track usage in the console.