OpenAI-compatible chat completions API. Replace the base URL and keep your existing code.
https://keymeai.com/v1
Include your API key in the Authorization header. Get your key at keymeai.com/signup.
export KEYMEAI_KEY="km-your-key-here"
Create a chat completion. Compatible with the OpenAI chat completions format.
curl -s https://keymeai.com/v1/chat/completions \ -H "Authorization: Bearer $KEYMEAI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-chat", "messages": [ {"role": "user", "content": "Explain quantum computing in simple terms"} ] }'
| Parameter | Type | Description |
|---|---|---|
model | string | Model ID. See available models below. |
messages | array | Array of message objects with role and content. |
temperature | float | Sampling temperature (0-2). Default: 0.7 |
max_tokens | integer | Maximum tokens in the response. Optional. |
stream | boolean | Enable streaming responses. Default: false |
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1779000000,
"model": "deepseek-chat",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses quantum bits..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 45,
"total_tokens": 57
}
}
| Model ID | Provider | Best for |
|---|---|---|
deepseek-chat | DeepSeek | General purpose, coding, analysis |
deepseek-reasoner | DeepSeek | Math, logic, complex reasoning |
doubao-pro-32k | ByteDance | Long documents, 32K context |
qwen-max | Alibaba Cloud | Creative writing, multi-language |
qwen-plus | Alibaba Cloud | Fast, cost-effective throughput |
import requests url = "https://keymeai.com/v1/chat/completions" headers = { "Authorization": "Bearer km-your-key-here", "Content-Type": "application/json" } data = { "model": "deepseek-chat", "messages": [{"role": "user", "content": "Hello!"}] } response = requests.post(url, headers=headers, json=data) print(response.json()["choices"][0]["message"]["content"])
KeyMeAI is compatible with the OpenAI Python SDK. Just change the base URL:
from openai import OpenAI client = OpenAI( api_key="km-your-key-here", base_url="https://keymeai.com/v1" ) response = client.chat.completions.create( model="deepseek-chat", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
| Tier | Rate Limit |
|---|---|
| Free | 100 requests / day |
| Hobby | 5M tokens / month |
| Standard | No hard limit (fair use) |
| Scale | Custom |
| Status | Meaning |
|---|---|
| 200 | Success |
| 401 | Invalid or missing API key |
| 429 | Rate limit exceeded |
| 500 | Server or upstream model error |
| 503 | All upstream models temporarily unavailable |