Loading...
Loading...
Complete reference for the AisaysAI API. Base URL: https://api.aisays.ai
/v1/chat/completionsAuthCreate a chat completion (OpenAI format)
/v1/responsesAuthCreate a response (OpenAI Responses API — native Codex CLI protocol)
/anthropic/v1/messagesAuthCreate a message (Anthropic format)
// Create a chat completion
const response = await fetch("https://api.aisays.ai/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
model: "deepseek/deepseek-v4-flash",
messages: [{ role: "user", content: "Hello!" }],
}),
})
const data = await response.json()
console.log(data.choices[0].message.content)API endpoints marked with Auth require authentication via a Bearer token in the Authorization header.
You can create API keys from the API Keys page in your workspace.
Authorization: Bearer sk-or-xxxxxxxxxxxxxxxxxxxxxxxx
Models don't know who they are from their weights alone — a model's name and version are supplied at inference via a system prompt, not baked into its parameters. If you ask a model "what model are you?" through a gateway, it may misidentify itself (an industry-wide limitation known as identity confusion). This is not a routing problem: Aisays.ai always routes your request to the exact model you select.
How to verify the model you received
Trust the model field in the API response — it is set by Aisays.ai and reflects the exact model that served your request — not the model's self-reported text:
{
"model": "deepseek/deepseek-v4-flash",
"choices": [ { "message": { "content": "..." } } ]
}Making a model state a specific identity
Send your own system message and the model will follow it:
{ "role": "system", "content": "You are DeepSeek V4 Flash." }Our Chat playground auto-injects a model-identity system message by default (toggle it with the fingerprint icon) so models self-identify correctly. The raw /v1 API never injects model-identity prompts — it forwards your messages as sent (technical fields like the model ID are normalized server-side for routing and billing).