Create chat completion
Creates a chat completion for the given messages. This endpoint is a drop-in replacement
for the OpenAI Chat Completions API — it accepts the same request schema and returns the
same response format, including usage with token counts.
The router selects a provider that serves the requested model, forwards the request, streams (or batches) the response, and calculates cost from actual token usage.
Authorization
SIWx Base64-encoded JSON envelope containing a CAIP-122 sign-in message and its cryptographic signature.
{
"message": "<CAIP-122 message>",
"signature": "<base58 for Solana, hex for EVM>"
}In: header
Request Body
application/json
Model ID to use for the completion (e.g. gpt-4o, claude-sonnet-4).
A list of messages comprising the conversation so far.
Sampling temperature (0.0–2.0).
0 <= value <= 2Nucleus sampling parameter.
0 <= value <= 1Number of completions to generate.
1Whether to stream partial responses using SSE.
falseUp to 4 sequences where the API will stop generating.
Maximum number of tokens to generate.
Presence penalty (-2.0 to 2.0).
Frequency penalty (-2.0 to 2.0).
A unique identifier representing your end-user.
Response Body
application/json
application/json
application/json
curl -X POST "https://beta.aimo.network/api/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [ { "role": "system", "content": "string" } ] }'{
"id": "string",
"object": "chat.completion",
"created": 0,
"model": "string",
"choices": [
{
"index": 0,
"message": {
"role": "system",
"content": "string"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}