Documentation
Welcome to the CTIM AI documentation. This guide will help you get started quickly and make full use of our AI infrastructure services.
About CTIM AI
Learn about our basic information and service details.
Overview
CTIM AI is a unified API gateway that provides access to all major AI models through a single OpenAI-compatible endpoint. Switch between models by changing one parameter — no code changes needed.
API Address
https://api.ctimsoft.net/ai Supported Models
- Model List — Full list of available models and providers
- Model Pricing — Transparent per-token pricing for all models
Getting Started
Detailed user guides and operation steps to start making API calls.
Quick Start
- 1Contact us via Telegram or email to get your API key — typically within 2 hours.
- 2Set base URL to
https://api.ctimsoft.net/aiand replace your API key. - 3Start making requests — the OpenAI SDK works out of the box.
OpenAI SDK Usage
Change the base_url, everything else stays the same.
from openai import OpenAI
client = OpenAI(
api_key="API_KEY",
base_url="https://api.ctimsoft.net/ai"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content) curl -X POST https://api.ctimsoft.net/ai/chat/completions \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello"}]
}' Anthropic SDK Usage
Use our gateway with the Anthropic Messages API — just change the base URL.
import anthropic
client = anthropic.Anthropic(
api_key="API_KEY",
base_url="https://api.ctimsoft.net/ai"
)
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}]
)
print(message.content[0].text) Response Format
CTIM AI gateway is fully compatible with the OpenAI API — response structures are identical. Here's what you'll get back:
Success Response (200)
Standard chat completion response:
{
"id": "chatcmpl-9XyZ...b",
"object": "chat.completion",
"created": 1720000000,
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 12,
"total_tokens": 20,
"prompt_tokens_details": { "cached_tokens": 0 },
"completion_tokens_details": { "reasoning_tokens": 0 }
},
"service_tier": "default",
"system_fingerprint": "fp_ctim"
} Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique request ID (e.g. chatcmpl-xxx) |
| object | string | Always "chat.completion" |
| created | integer | Unix timestamp of the response |
| model | string | Actual model used (may differ from request if fallback) |
| choices | array | Array of completion choices (usually 1 unless n > 1) |
| choices[0].message | object | Contains role, content, and optional tool_calls |
| choices[0].finish_reason | string | One of: stop, length, tool_calls, content_filter |
| usage | object | Token usage: prompt_tokens, completion_tokens, total_tokens |
Streaming Response
When stream: true is set, the response is delivered as Server-Sent Events (SSE). Each line starts with data: followed by a JSON chunk:
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1720000000,"model":"gpt-4o","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1720000000,"model":"gpt-4o","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1720000000,"model":"gpt-4o","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1720000000,"model":"gpt-4o","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE] Each chunk contains a delta field with incremental content. The final chunk has finish_reason set and empty delta.content.
Error Response
All errors follow the OpenAI error format:
{
"error": {
"message": "Invalid API key provided",
"type": "invalid_request_error",
"param": "api_key",
"code": "invalid_api_key"
}
} Common HTTP Status Codes
| Status | Meaning | Common Cause |
|---|---|---|
| 200 | Success | Request completed normally |
| 400 | Bad Request | Invalid parameters (missing messages, bad model name) |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | API key doesn't have access to this model |
| 429 | Rate Limited | Too many requests or exceeded token quota |
| 500 | Server Error | Upstream provider failure — try again |
| 503 | Service Unavailable | Model or provider temporarily unavailable |
Platform Operations
Manage your API keys, monitor usage, and configure access controls.
API Key Management
Each API key can be configured with:
- Model-level access control (allow/deny specific models)
- Rate limits (requests per minute, tokens per day)
- Usage alerts (notify when balance drops below threshold)
- IP whitelist (restrict access to specific IP ranges)
Rate Limits & Quotas
Default rate limits apply per API key. Contact us for custom limits or enterprise plans.
| Tier | RPM | TPM | Description |
|---|---|---|---|
| Free | 10 | 10,000 | Trial |
| Basic | 60 | 100,000 | Paid starter |
| Pro | 300 | 500,000 | Primary tier |
| Enterprise | 1000+ | 2M+ | Custom |
Quick Navigation
Recommended path for new users:
- 1 Introduction — What is CTIM AI
- 2 Quick Start — Get your API key in 2 minutes
- 3 Create API Key — Manage keys and access
- 4 OpenAI SDK Usage — One line change, all models
- 5 Response Format — JSON structure & error handling
- 6 Model Parameters — Rate limits and pricing
Frequently Asked Questions
Account Related
API Usage
Billing
Technical Support
If you encounter problems during use, you can get help through the following methods: