Quick Start
Get your first AI response in under 5 minutes. AltAPI is 100% OpenAI-compatible — you only need to change your base URL and API key.
快速入门
5分钟内获得第一个AI响应。AltAPI 100%兼容OpenAI接口——您只需更改base URL和API密钥即可。
Change
base_url and api_key. Done. No other changes needed.
更改 base_url 和 api_key 即可。无需其他任何修改。
Go to your Dashboard → API Keys → click New Key. Copy the key — it starts with vg-.
前往控制台 → API密钥 → 点击新建密钥。复制密钥,它以 vg- 开头。
Your key is shown once. Copy and store it securely. If lost, delete and create a new key.
密钥仅显示一次。请复制并妥善保存。如丢失,请删除后重新创建。
bash
pip install openai
Python
from openai import OpenAI
client = OpenAI(
api_key = "sk-your-api-key",
base_url = "https://api.altapi.ai/v1"
)
response = client.chat.completions.create(
model = "gpt-5",
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)
gpt-5
claude-sonnet-4-6
deepseek-reasoner
gemini-2.5-pro
grok-4-0709
qwen3-max
+ 215 models
gpt-5 | OpenAI | 1M | $2.40 |
claude-sonnet-4-6 | Anthropic | 200K | $3.00 |
gemini-2.5-pro | 1M | $1.25 | |
deepseek-reasoner | DeepSeek | 128K | $0.55 |
qwen3-max | Alibaba | 128K | $0.80 |
grok-4-0709 | xAI | 256K | $3.00 |