How auto chooses
The rules behind the model auto.
API
One endpoint for chat. Name a model, or send auto.
Send messages to a model, or to auto; the reply says which model answered and what it cost.
| Field | What it is |
|---|---|
| model | A model id from the Model Hub, or auto. Required. |
| messages | The conversation: each has a role (system, user or assistant) and content. Required. |
| temperature | How varied the wording is. Optional. |
| max_tokens | The most the model may write. Optional. |
| stream | True to receive the answer as it is written. Optional. |
{
"model": "auto",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}The reply has the model’s answer and model, provider, fallback and usage (tokens, credits, remaining). With auto it also has routing: the task it was sorted into and how many models qualified. See routing.
POST /v1/ai/chat at https://api.mayuai.com, with an API key or an account token.
A model and the messages are required. Temperature, a maximum length and stream are optional.
Set stream to true in the request.
The reply carries the model, the provider, whether another model was tried, and the usage: tokens, credits charged and credits remaining. With auto it also says the kind of task the request was sorted into.
One endpoint for chat: name a model or send auto, and read which model answered and what it cost.
Existing accounts can sign in. To ask about access, contact us.