One API key. 500+ AI models. OpenAI SDK compatible. Get started in under 2 minutes.
Three steps to your first API call.
Sign up for free, then create a token in the Dashboard → Tokens page. No credit card required.
Point your OpenAI SDK or HTTP client to: https://aihubapi.ai/v1
Pick any model and send a request:
curl https://aihubapi.ai/v1/chat/completions \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [{"role": "user", "content": "Hello!"}] }'
from openai import OpenAI client = OpenAI( api_key="sk-your-api-key", base_url="https://aihubapi.ai/v1" ) response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'sk-your-api-key', baseURL: 'https://aihubapi.ai/v1', }); const response = await client.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'user', content: 'Hello!' }], }); console.log(response.choices[0].message.content);
import "github.com/sashabaranov/go-openai" config := openai.DefaultConfig("sk-your-api-key") config.BaseURL = "https://aihubapi.ai/v1" client := openai.NewClientWithConfig(config) resp, _ := client.CreateChatCompletion(ctx, openai.ChatCompletionRequest{ Model: "gpt-4o", Messages: []openai.ChatCompletionMessage{ {Role: "user", Content: "Hello!"}, }, })
| Item | Value |
|---|---|
| Base URL | https://aihubapi.ai/v1 |
| API Key format | sk-xxxxxxxxxxxx |
| HTTP Header | Authorization: Bearer sk-xxxxxxxxxxxx |
| Dashboard | https://aihubapi.ai/console |
Most OpenAI-compatible SDKs read these automatically:
export OPENAI_API_KEY=sk-your-api-key export OPENAI_BASE_URL=https://aihubapi.ai/v1
Create a chat completion. Supports all OpenAI-compatible parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID, e.g. gpt-4o, claude-sonnet-4.6, deepseek-chat |
| messages | array | Yes | Array of message objects with role and content |
| stream | boolean | No | Enable SSE streaming (default: false) |
| temperature | number | No | Sampling temperature, 0–2 (default: 1) |
| max_tokens | integer | No | Maximum tokens to generate |
| top_p | number | No | Nucleus sampling |
| frequency_penalty | number | No | -2.0 to 2.0 |
| presence_penalty | number | No | -2.0 to 2.0 |
| stop | string/array | No | Up to 4 stop sequences |
| tools | array | No | Function/tool definitions for tool calling |
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1712345678,
"model": "gpt-4o",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}
Set "stream": true to receive Server-Sent Events. Each event is a JSON chunk:
data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"Hello"}}]}
data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"!"}}]}
data: [DONE]
List all available models. Returns an array of model objects with id, object, created, and owned_by fields.
curl https://aihubapi.ai/v1/models \ -H "Authorization: Bearer sk-your-api-key"
| HTTP Code | Meaning | What to do |
|---|---|---|
| 400 | Bad request | Check request body format and required fields |
| 401 | Unauthorized | Verify your API key is valid and correctly formatted |
| 402 | Insufficient quota | Top up credits in the Dashboard |
| 429 | Rate limited | Back off and retry with exponential backoff |
| 500 | Server error | Retry; contact support if persistent |
| 503 | No channel available | Model may be temporarily unavailable; try a different model |
Error responses follow this format:
{
"error": {
"code": "model_not_found",
"message": "No available channel for model X under group default",
"type": "new_api_error"
}
}
AIHubAPI provides access to 350+ models from all major providers via a single API. Here are the most popular ones:
| Model | Description |
|---|---|
| gpt-4o | Flagship multimodal model, fast and capable |
| gpt-4o-mini | Affordable small model for lightweight tasks |
| gpt-4-turbo | GPT-4 Turbo with vision |
| o3 | Advanced reasoning model |
| o4-mini | Fast reasoning model |
| gpt-4.1 | Latest GPT-4 series |
| Model | Description |
|---|---|
| claude-sonnet-4.6 | Latest Claude, excellent for coding & analysis |
| claude-opus-4.6 | Most capable Claude model |
| claude-haiku-4.5 | Fast and affordable |
| claude-sonnet-4 | Balanced performance |
| Model | Description |
|---|---|
| gemini-2.5-pro | Most capable Gemini model |
| gemini-2.5-flash | Fast multimodal model |
| gemini-2.5-flash-lite | Lightweight and fast |
| Model | Description |
|---|---|
| deepseek-chat | General chat, very cost-effective |
| deepseek-v3.2 | Latest DeepSeek V3 |
| deepseek-r1 | Reasoning model |
| Model | Description |
|---|---|
| llama-4-maverick | Meta's latest large model |
| mistral-large | Mistral's flagship |
| qwen3-235b-a22b | Alibaba's Qwen 3 |
| grok-4 | xAI's latest Grok |
gpt-4o or full provider-prefixed names like openai/gpt-4o. Both work. Run GET /v1/models for the complete list of 350+ available models.AIHubAPI works with any OpenAI-compatible SDK. No special client needed.
from openai import OpenAI client = OpenAI( api_key="sk-your-api-key", base_url="https://aihubapi.ai/v1" ) stream = client.chat.completions.create( model="claude-sonnet-4.6", messages=[{"role": "user", "content": "Explain quantum computing"}], stream=True ) for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="")
import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'sk-your-api-key', baseURL: 'https://aihubapi.ai/v1', }); const stream = await client.chat.completions.create({ model: 'deepseek-chat', messages: [{ role: 'user', content: 'Hello!' }], stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content || ''); }
package main import ( "context" "fmt" openai "github.com/sashabaranov/go-openai" ) func main() { config := openai.DefaultConfig("sk-your-api-key") config.BaseURL = "https://aihubapi.ai/v1" client := openai.NewClientWithConfig(config) resp, _ := client.CreateChatCompletion( context.Background(), openai.ChatCompletionRequest{ Model: "gpt-4o", Messages: []openai.ChatCompletionMessage{ {Role: "user", Content: "Hello!"}, }, }, ) fmt.Println(resp.Choices[0].Message.Content) }
Any tool that supports a custom OpenAI base URL works with AIHubAPI.
Settings → Models → OpenAI API Key: sk-your-api-key
Override OpenAI Base URL: https://aihubapi.ai/v1
{
"models": [{
"provider": "openai",
"model": "deepseek-chat",
"apiBase": "https://aihubapi.ai/v1",
"apiKey": "sk-your-api-key"
}]
}
aider --openai-api-base https://aihubapi.ai/v1 --openai-api-key sk-your-api-key
Settings → Language Model → OpenAI → API Proxy URL: https://aihubapi.ai/v1
Settings → Model Services → Add custom provider → API URL: https://aihubapi.ai
gpt-4o, claude-sonnet-4-6) or full OpenRouter slugs (openai/gpt-4o). Both are supported.sk-, (2) key is not expired or disabled, (3) you have sufficient quota, (4) header format is Authorization: Bearer sk-....