Developer platform

Integrate models through one unified API

AITransX provides chat, image generation and speech synthesis APIs. Use one API key across models and manage usage, logs and access limits from the dashboard.

Online playground

Try models in your browser

Try chat, image generation and speech in the browser, then use the examples below to integrate the API.

Chat with AI Create images Speech synthesis
Try models now Sign in first, then continue automatically
Setup

Use one base_url and one API key

Configure the unified API endpoint and Bearer key, then select a stable model ID to route requests through AITransX.

API base URL

Use this as the OpenAI SDK base_url. For slow image models, point it at a direct API subdomain to avoid proxy read timeouts.

OpenAI SDK
base_url = "https://api.aitransx.com/v1"

Authentication

Every private request must include your API key. Create and manage keys from the dashboard.

HTTP
Authorization: Bearer aitx-your-key
Content-Type: application/json

Model IDs

Only a few common model ID formats are shown below. Check GET /v1/models for currently available models.

Models
GET https://api.aitransx.com/v1/models

model = "auto"
model = "gpt-5.6-sol"
model = "deepseek@deepseek-v4-pro"
Core APIs

Chat, image and speech APIs

Use chat completions for text and multimodal conversations, image generations for image output, and audio speech for text-to-speech.

POST /v1/chat/completions

Chat completions

Send OpenAI-compatible requests to /v1/chat/completions. The example uses gpt-5.6-sol and supports streaming with stream: true.

cURL
curl https://api.aitransx.com/v1/chat/completions \
  -H "Authorization: Bearer aitx-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": false
  }'
Python SDK
Python
from openai import OpenAI

client = OpenAI(
    api_key="aitx-your-key",
    base_url="https://api.aitransx.com/v1",
)

completion = client.chat.completions.create(
    model="gpt-5.6-sol",
    messages=[
        {"role": "user", "content": "Hello"},
    ],
    stream=False,
)

print(completion.choices[0].message.content)
POST /v1/images/generations

Text-to-image generation

Send a model ID and prompt to /v1/images/generations to generate an image from text. The Python SDK example saves the returned b64_json as out.png.

cURL
curl https://api.aitransx.com/v1/images/generations \
  -H "Authorization: Bearer aitx-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a premium product render of a white ceramic cup",
    "size": "1024x1024",
    "response_format": "b64_json"
  }'
Python SDK
Python
import base64
from openai import OpenAI

client = OpenAI(
    api_key="aitx-your-key",
    base_url="https://api.aitransx.com/v1",
    timeout=140,
)

result = client.images.generate(
    model="gpt-image-2",
    prompt="a premium product render of a white ceramic cup",
    size="1024x1024",
    response_format="b64_json",
)

with open("out.png", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))
POST /v1/images/generations

Reference-image generation

Use the same /v1/images/generations endpoint with input_references to edit an image or generate from references. Replace the public image URL in the cURL example; the Python SDK example reads a local reference.png and saves edited.png. Pass input_references through extra_body in the SDK.

Choose a model that supports reference images. PNG, JPEG and WebP are supported; each original image must be 4 MB or smaller before base64 encoding. Include up to four references in array order; some models accept fewer.

cURL
curl https://api.aitransx.com/v1/images/generations \
  -H "Authorization: Bearer aitx-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Keep the cup shape and change its color to blue",
    "size": "1024x1024",
    "response_format": "b64_json",
    "input_references": [
      {
        "type": "image_url",
        "image_url": {"url": "https://example.com/reference.png"}
      }
    ]
  }'
Python SDK
Python
import base64
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key="aitx-your-key",
    base_url="https://api.aitransx.com/v1",
    timeout=140,
)

reference_bytes = Path("reference.png").read_bytes()
reference_b64 = base64.b64encode(reference_bytes).decode("ascii")
reference_url = "data:image/png;base64," + reference_b64

result = client.images.generate(
    model="gpt-image-2",
    prompt="Keep the cup shape and change its color to blue",
    size="1024x1024",
    response_format="b64_json",
    extra_body={
        "input_references": [
            {
                "type": "image_url",
                "image_url": {"url": reference_url},
            },
        ],
    },
)

with open("edited.png", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))
POST /v1/audio/speech

Speech synthesis

Send text, a voice and an audio format to /v1/audio/speech. A successful request returns an audio file you can save or play, billed at the selected model's character rate.

cURL
curl https://api.aitransx.com/v1/audio/speech \
  -H "Authorization: Bearer aitx-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen-audio-3.0-tts-flash",
    "input": "Hello from AITransX",
    "voice": "longanhuan_v3.6",
    "response_format": "mp3"
  }' \
  --output speech.mp3
Python SDK
Python
from openai import OpenAI

client = OpenAI(
    api_key="aitx-your-key",
    base_url="https://api.aitransx.com/v1",
)

with client.audio.speech.with_streaming_response.create(
    model="qwen/qwen-audio-3.0-tts-flash",
    input="Hello from AITransX",
    voice="longanhuan_v3.6",
    response_format="mp3",
) as response:
    response.stream_to_file("speech.mp3")

Web search and page fetching

Enable Web search in the chat composer to let your selected model answer using web sources. Numbered citations let you inspect those sources. Queries are generated automatically; search settings let you choose keywords, source sites and a planning model. Developers can use their own AITransX API key with the Search / Fetch endpoints below to retrieve web content.

POST /v1/tools/search

DeepSeek Search

query accepts 1–128 characters. Optional count is 1–50, default 10; need_content requests page content. You can also supply ori_question (the original question) and localization (an IP address). DeepSeek tool documentation

cURL
curl https://api.aitransx.com/v1/tools/search \
  -H "Authorization: Bearer aitx-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "DeepSeek API search",
    "count": 5,
    "need_content": true
  }'
POST /v1/tools/fetch

DeepSeek Fetch

url is one HTTP or HTTPS page address. Search returns a results array; Fetch returns title and content for use in subsequent model requests.

cURL
curl https://api.aitransx.com/v1/tools/fetch \
  -H "Authorization: Bearer aitx-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api-docs.deepseek.com/"
  }'

Per-request pricing

Clearly self-contained tasks go straight to the chat model and incur only its usage charge. When research is needed, planning, searches, page reads and answers are billed separately for actual usage, with up to three searches and two page reads per answer. Manual keywords and direct reading of specified URLs skip planning. Search and Fetch are billed per successful request with nonempty results; failures, timeouts and empty results have no tool charge. Completed charges remain if a later step fails or is stopped. See the price table for rates and request logs for actual charges. Pricing

Usage and availability

The platform provides web search for all enabled chat models. Turn it on in the chat composer; no extra setup is required. If temporarily unavailable, continue chatting with web search turned off or contact support.

Contact support
Operations

Limits, logs and responses

Use limits to control spend, review metadata logs, and handle normal JSON error responses in clients.

Spend and traffic controls

Before production traffic, configure limits per key and monitor request logs from the dashboard.

Balance check before dispatch Monthly token cap per key RPS limit per key Exportable request logs

Logs and privacy

Dashboard logs keep operational metadata such as model, provider, request usage, cost, latency and status. Prompt, response and audio bodies are not written to disk.

Common responses

Error responses use normal HTTP status codes and include a JSON error message for client handling.

StatusMeaningSuggested action
400
content_policy_violation
Image generation was rejected by content safety checks. No charge was incurred.Revise the prompt or reference images, then submit a new request.
401Missing, invalid or revoked API keyCreate a new key or check the Bearer token.
402Insufficient balance or the requested model range is not enabled for this accountAdd account balance to enable the full model catalog, or select a currently available model.
429Rate limit or concurrency limit reachedRetry with backoff or increase the key limit.
503No healthy upstream route for the requested modelCheck /v1/models, switch model ID or contact support.

Public endpoints

EndpointPurposeAuth
GET /v1/modelsList routable model IDsNo key required
GET /api/pricingList public model pricesNo key required
POST /v1/chat/completionsCreate a chat completionBearer key
POST /v1/images/generationsCreate an image generationBearer key
POST /v1/audio/speechGenerate speech from textBearer key
POST /v1/tools/searchWeb search (per request)Bearer key
POST /v1/tools/fetchPage content fetch (per request)Bearer key
GET /healthzService health checkNo key required

Cookie preferences

Manage optional features separately below. Declining does not affect sign-in, model requests or billing.

Essential cookies & functional storage

Supports sign-in and security, and remembers your chosen language, appearance, model settings and cookie preferences.

Always on

This browser remembers your choices for 180 days. Signed-in analytics choices are also saved to your account. You can change them at any time in Cookie settings. Privacy policy