Everything you need to integrate AiPorter into your application. OpenAI-compatible, 70% cheaper.
Getting started with AiPorter takes less than 5 minutes. The API is fully compatible with the OpenAI SDK — just change the base URL.
Create a free account to get your API key.
pip install openai # Python npm install openai # Node.js go get github.com/sashabaranov/go-openai # Go
from openai import OpenAI
client = OpenAI(
api_key="aiporter-sk-xxxxx",
base_url="https://sg1.api.aiporter.io/v1"
)
response = client.chat.completions.create(
model="aiporter-pro",
messages=[
{"role": "user", "content": "Hello, AiPorter!"}
]
)
print(response.choices[0].message.content)
All API requests require authentication using an API key. Include your key in the Authorization header.
Authorization: Bearer aiporter-sk-xxxxx
API keys can be created and managed from your Dashboard. Keep your keys secure and never share them publicly.
Choose the endpoint closest to your users for optimal latency:
| Region | Endpoint | Avg Latency |
|---|---|---|
| Singapore 🇸🇬 | https://sg1.api.aiporter.io/v1 | ~45ms |
| Dubai 🇦🇪 | https://ae1.api.aiporter.io/v1 | ~62ms |
| Tokyo 🇯🇵 | https://jp1.api.aiporter.io/v1 | ~38ms |
| Frankfurt 🇩🇪 | https://eu1.api.aiporter.io/v1 | ~55ms |
| Virginia 🇺🇸 | https://us1.api.aiporter.io/v1 | ~72ms |
Create a chat completion. Compatible with OpenAI's /v1/chat/completions endpoint.
POST /v1/chat/completions
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g., aiporter-pro, deepseek-v3). See available models below. |
messages | array | Yes | Array of message objects with role and content |
temperature | number | No | Sampling temperature (0-2). Default: 0.7 |
max_tokens | integer | No | Maximum tokens in response |
stream | boolean | No | Enable streaming. Default: false |
curl https://sg1.api.aiporter.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aiporter-sk-xxxxx" \
-d '{
"model": "aiporter-pro",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain machine learning in simple terms."}
],
"temperature": 0.7,
"max_tokens": 500
}'
| Model ID | Provider | Type | Context | Price |
|---|---|---|---|---|
aiporter-pro | Auto Route | Chat | 128K | $0.50/M tokens |
deepseek-v3 | DeepSeek | Chat | 128K | $0.50/M tokens |
qwen-2.5-72b | Qwen | Chat | 128K | $0.35/M tokens |
glm-4v | GLM | Vision | 128K | $0.80/M tokens |
aiporter-fast | Auto Route | Chat (Optimized) | 32K | $0.25/M tokens |
| Plan | Requests/min | Tokens/min |
|---|---|---|
| Starter | 60 | 100,000 |
| Pro | 600 | 1,000,000 |
| Enterprise | Custom | Custom |
Rate limits are applied per API key. Enterprise customers can request custom limits.