Create a chat completion
OpenAI Chat Completions through your groups. The response also names the group and the source that answered.
POST
https://borminto.com/api/v1/chat/completions
Authentication
Send Authorization: Bearer $BORMINTO_ARMY_KEY, an application key or a group key.
Request
modelstring · required- A model ID from List models, such as
openai/gpt-6.2-sol. Not needed when you sendmodels. messagesarray · required- Up to 256 messages. Roles:
system,developer,user,assistant,tool. Content is text, or a list of text parts. groupstring · optional- A group’s API name. Not needed with a group key.
modelsstring[] · optional- Up to 5 models, tried in order when every source of the previous one is busy or failing.
providerobject · optionalonly,ignore,order,allow_fallbacks. See Groups and routing.streamboolean · optional- Send the answer as Server-Sent Events. See Streaming.
toolsarray · optional- Function tools, with
tool_choiceandparallel_tool_calls. See Tool calling. max_tokensinteger · optional- 16 to 32,768. Or send
max_completion_tokens, not both. temperature, top_p, stop, seedvarious · optional- Also
presence_penalty,frequency_penaltyandresponse_format. Sources that support them use them; others ignore them. service_tierstring · optionaldefault,autoorpriority. Priority uses only sources that confirmed it.
Response fields
The OpenAI fields, plus group and provider: the group and source that answered. Keep id to look the request up with Request details.
Errors
| Status | Code | What to do |
|---|---|---|
| 400 | invalid_request | A field is missing or not valid. Read error.message. |
| 400 | unsupported_content | Images and audio are not supported yet. Send text. |
| 400 | tools_unsupported | No source of this model can call tools. Use a model from an OpenAI-format source or a ChatGPT account. |
| 400 | group_mismatch | A group key was sent with the name of another group. |
| 401 | invalid_api_key | The key is missing, turned off or not an army_ key. |
| 404 | model_not_found | The model is not served for this key or group. List models first. |
| 404 | group_not_found | No group has this API name. |
| 404 | no_provider | provider.only or provider.ignore left no source for the model. |
| 429 | rate_limited | A request, parallel or monthly token limit was reached. Wait for Retry-After. |
| 502 | provider_error | Every eligible source failed. Try again. |
| 503 | group_disabled | The application or group is paused, or no source is available now. |