API Documentation
Integrate ZapAI with simple HTTP calls — OpenAI-compatible interface
Quick Start
- 1Create an API Key on the Settings page. You'll get a key in the format
sk-zap-xxxx(shown only once — save it securely). - 2Send a POST request to the API endpoint with your key in the Authorization header.
- 3The system automatically routes to the best model based on request complexity, and tracks usage and costs.
API Endpoint
POST
/api/v1/chat/completionsCompatible with the OpenAI Chat Completions protocol. The request body includes model and messages fields. Authenticate with Authorization: Bearer <your API Key>.
Code Examples
curl
curl -X POST https://zachie.site/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-zap- your-api-key" \
-d '{
"model": "hy3",
"messages": [
{ "role": "user", "content": "Hello, introduce yourself" }
]
}'Python
import requests
resp = requests.post(
"https://zachie.site/api/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer sk-zap- your-api-key",
},
json={
"model": "hy3",
"messages": [
{"role": "user", "content": "Hello, introduce yourself"}
],
},
)
print(resp.json())JavaScript
const resp = await fetch(
"https://zachie.site/api/v1/chat/completions",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer sk-zap- your-api-key",
},
body: JSON.stringify({
model: "hy3",
messages: [{ role: "user", content: "Hello, introduce yourself" }],
}),
);
const data = await resp.json();
console.log(data);Supported Models & Pricing
| Model | Tier | Use Case | Input Price (USD/M tokens) | Output Price (USD/M tokens) |
|---|---|---|---|---|
| hy3 | Budget | Daily chat, casual conversation | $0.14 | $0.54 |
| deepseek-v4-flash | Standard | Reasoning, code, analysis | $0.72 | $3.60 |
| glm-5.3 | Premium | Complex tasks, high-quality output | $2.25 | $9.00 |
* The system automatically selects the best model based on request complexity. You can also explicitly specify the model field in your request.