API Documentation

Integrate China's most powerful AI models into your application with just a few lines of code. Our API is fully compatible with OpenAI's format.

Quick Start

Get Your API Key

Create an Account

Sign up for free at api.sib-ai.com/#/register

Get Your API Key

Navigate to the dashboard and copy your API key. It starts with sib-

Make Your First Request

Use the API key to make requests to any of our supported models.

💡 New users: Get $5 in free credits when you sign up. No credit card required.

Python SDK

Install the OpenAI SDK and configure it to use SIB AI's endpoint:

Python
# Install the OpenAI SDK
pip install openai

# Create a file named example.py
from openai import OpenAI

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

response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[
        {
            "role": "user",
            "content": "Hello! What models are available?"
        }
    ]
)

print(response.choices[0].message.content)

cURL

Make API calls directly from your terminal:

bash
curl https://api.sib-ai.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_SIB_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-chat",
    "messages": [
      {
        "role": "user",
        "content": "Hello! What models are available?"
      }
    ]
  }'

Node.js SDK

For Node.js applications, use the OpenAI SDK:

JavaScript
// Install: npm install openai
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'your-sib-ai-api-key',
  baseURL: 'https://api.sib-ai.com/v1',
});

async function main() {
  const response = await client.chat.completions.create({
    model: 'deepseek-chat',
    messages: [
      {
        role: 'user',
        content: 'Hello! What models are available?'
      }
    ]
  });
  
  console.log(response.choices[0].message.content);
}

main();

Authentication

SIB AI uses API keys to authenticate requests. You can view and manage your API keys in your dashboard.

Bearer Token

Include your API key in the Authorization header of all requests:

Authorization: Bearer sib-your-api-key-here

Security Best Practices

⚠️ Keep your API key secure: Never expose your API key in client-side code, public repositories, or share it publicly.
  • Use environment variables to store your API key
  • Rotate your API key periodically
  • Create separate keys for different applications
  • Monitor your API usage for anomalies

Models Reference

SIB AI provides access to the following AI models. All models are accessible through the same API endpoint.

Model ID Description Input Price Output Price Max Context
deepseek-chat DeepSeek V4 Flash - Fast, cost-effective for general tasks $0.18/1M tokens $0.36/1M tokens 128K
deepseek-v3 DeepSeek V3.2 - Balanced performance for diverse tasks $0.36/1M tokens $0.54/1M tokens 128K
deepseek-reasoner DeepSeek R1 - Advanced reasoning for complex problems $0.90/1M tokens $3.25/1M tokens 128K
qwen-plus Qwen3.6-Plus - Superior multilingual performance $0.40/1M tokens $1.20/1M tokens 128K
qwen-turbo Qwen3.6-Turbo - Lightning-fast for real-time applications $0.10/1M tokens $0.30/1M tokens 128K
glm-4-flash GLM-5.1-Flash - Optimized for Chinese language tasks $0.15/1M tokens $0.15/1M tokens 128K
💡 Model Selection Guide: Use qwen-turbo or deepseek-chat for fast responses. Use deepseek-reasoner for complex reasoning tasks.

Chat Completions API

Endpoint

POST https://api.sib-ai.com/v1/chat/completions

Request Parameters

Parameter Type Description
model* string The model ID to use. See Models Reference.
messages* array A list of message objects with role (system/user/assistant) and content.
stream boolean If true, responses are streamed back as Server-Sent Events. Default: false
temperature float Sampling temperature (0-2). Higher values make output more random. Default: 0.7
max_tokens integer Maximum number of tokens to generate. Default: 4096
top_p float Nucleus sampling parameter (0-1). Default: 1
frequency_penalty float Penalize new tokens based on existing frequency. Range: -2 to 2. Default: 0
presence_penalty float Penalize new tokens based on whether they appear. Range: -2 to 2. Default: 0
stop string/array Up to 4 sequences where the API will stop generating tokens.

Request Example

Python
from openai import OpenAI

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

response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Explain quantum computing in simple terms."
        }
    ],
    temperature=0.7,
    max_tokens=1024
)

print(response.choices[0].message.content)

Response Example

JSON Response
{
  "id": "chatcmpl-123abc456",
  "object": "chat.completion",
  "created": 1700000000,
  "model": "deepseek-chat",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Quantum computing is a type of computation..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 150,
    "total_tokens": 175
  }
}

Streaming Response

To receive responses as a stream (useful for chat interfaces):

Python
from openai import OpenAI

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

stream = client.chat.completions.create(
    model="deepseek-chat",
    messages=[{"role": "user", "content": "Tell me a story."}],
    stream=True
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Streaming Response Format

Server-Sent Events
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1700000000,"model":"deepseek-chat","choices":[{"index":0,"delta":{"content":"Quantum"},"finish_reason":null}]}

data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1700000000,"model":"deepseek-chat","choices":[{"index":0,"delta":{"content":" computing"},"finish_reason":null}]}

data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1700000000,"model":"deepseek-chat","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: [DONE]

Error Codes

SIB AI uses standard HTTP status codes and returns detailed error information in JSON format.

Status Code Error Code Description
400 invalid_request Malformed request body or missing required parameters
401 invalid_api_key Invalid or missing API key. Check your API key in the dashboard.
403 rate_limit_exceeded Rate limit exceeded. See Rate Limits.
422 invalid_model Invalid model ID. Check available models in the documentation.
429 too_many_requests Too many requests. Rate limit has been reached.
500 server_error Internal server error. Our team has been notified. Retry after a few seconds.
503 service_unavailable Service temporarily unavailable. Please retry later.

Error Response Format

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

Rate Limits

Rate limits vary by subscription plan. Limits are applied per API key.

Plan Requests/min Tokens/min Concurrent
Free 10 10,000 1
Pro ($20/mo) 100 100,000 5
Enterprise Custom Custom Custom
💡 Optimizing for Rate Limits: Implement exponential backoff for retries, use batch processing when possible, and consider upgrading your plan if you regularly hit limits.

Rate Limit Headers

Every response includes headers showing your current rate limit status:

X-RateLimit-Limit: 100           # Your plan limit
X-RateLimit-Remaining: 95       # Requests remaining
X-RateLimit-Reset: 1700000060   # Unix timestamp when limit resets