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

  1. 1Contact us via Telegram or email to get your API key — typically within 2 hours.
  2. 2Set base URL to https://api.ctimsoft.net/ai and replace your API key.
  3. 3Start making requests — the OpenAI SDK works out of the box.

OpenAI SDK Usage

Change the base_url, everything else stays the same.

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

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

JSON — 200 OK
{
  "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

FieldTypeDescription
idstringUnique request ID (e.g. chatcmpl-xxx)
objectstringAlways "chat.completion"
createdintegerUnix timestamp of the response
modelstringActual model used (may differ from request if fallback)
choicesarrayArray of completion choices (usually 1 unless n > 1)
choices[0].messageobjectContains role, content, and optional tool_calls
choices[0].finish_reasonstringOne of: stop, length, tool_calls, content_filter
usageobjectToken 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:

SSE Stream
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:

JSON — Error
{
  "error": {
    "message": "Invalid API key provided",
    "type": "invalid_request_error",
    "param": "api_key",
    "code": "invalid_api_key"
  }
}

Common HTTP Status Codes

StatusMeaningCommon Cause
200SuccessRequest completed normally
400Bad RequestInvalid parameters (missing messages, bad model name)
401UnauthorizedInvalid or missing API key
403ForbiddenAPI key doesn't have access to this model
429Rate LimitedToo many requests or exceeded token quota
500Server ErrorUpstream provider failure — try again
503Service UnavailableModel 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.

TierRPMTPMDescription
Free1010,000Trial
Basic60100,000Paid starter
Pro300500,000Primary tier
Enterprise1000+2M+Custom

Quick Navigation

Recommended path for new users:

  1. 1
    Introduction — What is CTIM AI
  2. 2
    Quick Start — Get your API key in 2 minutes
  3. 3
    Create API Key — Manage keys and access
  4. 4
    OpenAI SDK Usage — One line change, all models
  5. 5
    Response Format — JSON structure & error handling
  6. 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:

  • Telegram — Fastest response, 24/7
  • Email — For detailed inquiries and enterprise requests