Create Chat Completion
Changed onCreate a chat completion.
Generates a model response for the given conversation and configuration. Supports OpenAI-compatible parameters and provider-specific extensions.
Headers:
- Authorization: bearer key for the calling account.
- Optional BYOK or provider headers if applicable.
Behavior:
- If multiple models are supplied, the first one is used, and the agent may hand off to another model.
- Tools may be invoked on the server or signaled for the client to run.
- Streaming responses emit incremental deltas; non-streaming returns a single object.
- Usage metrics are computed when available and returned in the response.
Responses:
- 200 OK: JSON completion object with choices, message content, and usage.
- 400 Bad Request: validation error.
- 401 Unauthorized: authentication failed.
- 402 Payment Required or 429 Too Many Requests: quota, balance, or rate limit issue.
- 500 Internal Server Error: unexpected failure.
Billing:
- Token usage metered by the selected model(s).
- Tool calls and MCP sessions may be billed separately.
- Streaming is settled after the stream ends via an async task.
Example (non-streaming HTTP): POST /v1/chat/completions Content-Type: application/json Authorization: Bearer <key>
{ "model": "provider/model-name", "messages": [{"role": "user", "content": "Hello"}] }
200 OK { "id": "cmpl_123", "object": "chat.completion", "choices": [ {"index": 0, "message": {"role": "assistant", "content": "Hi there!"}, "finish_reason": "stop"} ], "usage": {"prompt_tokens": 3, "completion_tokens": 4, "total_tokens": 7} }
Example (streaming over SSE): POST /v1/chat/completions Accept: text/event-stream
data: {"id":"cmpl_123","choices":[{"index":0,"delta":{"content":"Hi"}}]} data: {"id":"cmpl_123","choices":[{"index":0,"delta":{"content":" there!"}}]} data: [DONE]
Request
- Base URLhttps://api.dedaluslabs.ai
- AuthHTTP bearer
Request body
Example request
{
"model_attributes": {
"gpt-5": {
"accuracy": 0.95,
"speed": 0.6
}
},
"agent_attributes": {
"accuracy": 0.9,
"complexity": 0.8
},
"max_turns": 5
}Response
JSON or SSE stream of ChatCompletionChunk events
Example response
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "The next Warriors game is tomorrow at 7:30 PM.",
"role": "assistant"
}
}
],
"created": 1677652288,
"id": "chatcmpl-123",
"model": "gpt-4o-mini",
"object": "chat.completion",
"tools_executed": [
"search_events",
"get_event_details"
],
"usage": {
"completion_tokens": 12,
"prompt_tokens": 9,
"total_tokens": 21
}
}Changes
- breaking
removed
subschema #2from the////request propertyanyOflist - breaking
removed
subschema #1: Responsemodalitiesfrom therequest propertyanyOflist - breaking
removed
subschema #2: Stopconfigurationfrom therequest propertyanyOflist - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
the request property
///became required - breaking
removed the enum value
24hof the request property/ - breaking
removed the enum value
autoof the request property/ - breaking
removed the enum value
autoof the request property/ - breaking
removed the enum value
defaultof the request property/ - breaking
removed the enum value
flexof the request property/ - breaking
removed the enum value
highof the request property/ - breaking
removed the enum value
highof the request property/ - breaking
removed the enum value
in-memoryof the request property/ - breaking
removed the enum value
lowof the request property/ - breaking
removed the enum value
lowof the request property/ - breaking
removed the enum value
mediumof the request property/ - breaking
removed the enum value
mediumof the request property/ - breaking
removed the enum value
minimalof the request property/ - breaking
removed the enum value
noneof the request property/ - breaking
removed the enum value
noneof the request property/ - breaking
removed the enum value
priorityof the request property/ - breaking
removed the enum value
scaleof the request property/ - breaking
removed the enum value
standard_onlyof the request property/ - breaking
request property
list-of-types was narrowed by removing typesstringfrom media typeapplication/json - breaking
request property
///list-of-types was narrowed by removing typesobjectfrom media typeapplication/json - breaking
request property
////list-of-types was narrowed by removing typesnullfrom media typeapplication/json - breaking
request property
////list-of-types was narrowed by removing typesobjectfrom media typeapplication/json - breaking
request property
///list-of-types was narrowed by removing typesnullfrom media typeapplication/json - breaking
request property
///list-of-types was narrowed by removing typesnullfrom media typeapplication/json - breaking
request property
///list-of-types was narrowed by removing typesnullfrom media typeapplication/json - breaking
the
////request property type changed from no type toobject - breaking
the
/////request property type changed fromobjecttoboolean - breaking
the
//request property type changed fromobjectto no type - breaking
added to the
////response propertyoneOflist for the response status (media type: application/json) - warning
the
///request property's min was set to1024.00 - warning
removed the request property
- warning
removed the request property
- warning
removed the request property
///// - warning
removed the request property
////// - warning
removed the request property
/// - warning
removed the request property
/// - info
added the new optional request property
- info
added the new optional request property
- info
added
subschema #1to therequest propertyanyOflist - info
added
subschema #1to therequest propertyanyOflist - info
the
request property default valueanywas removed - info
the
request property default valueautowas removed - info
the
request property default valuecontentwas removed - info
the
request property default valuedisabledwas removed - info
the
request property default valueenabledwas removed - info
the
request property default valuejson_objectwas removed - info
the
request property default valuejson_schemawas removed - info
the
request property default valuenonewas removed - info
the
request property default valuetextwas removed - info
the
request property default valuetoolwas removed - info
added discriminator to
//request property - info
added to the
//request propertyoneOflist - info
added to the
///response propertyanyOflist for the response status (media type: application/json) - info
removed from the
///response propertyanyOflist for the response status (media type: application/json) - info
mapped value for discriminator key
customchanged from to for////response property for the response status (media type: application/json) - info
removed from the
////response propertyoneOflist for the response status (media type: application/json)
- breaking
- breaking
added the new required request property
/// - breaking
added the new required request property
/// - breaking
added the new required request property
/// - breaking
added the new required request property
/// - breaking
added the new required request property
/// - breaking
removed from the
request propertyanyOflist - breaking
removed from the
request propertyanyOflist - breaking
removed
subschema #1from therequest propertyanyOflist - breaking
removed
subschema #1from therequest propertyanyOflist - breaking
removed
subschema #1subschema #2from therequest propertyanyOflist - breaking
request property
list-of-types was narrowed by removing typesnullfrom media typeapplication/json - breaking
request property
list-of-types was narrowed by removing typesobjectfrom media typeapplication/json - breaking
the
/request property's max was decreased to1.00 - breaking
the
/request property's max was decreased to8.00 - breaking
the
/request property type changed fromobjectto no type - breaking
added to the
////response propertyoneOflist for the response status - warning
the
/request property's max was set to9223372036854775808.00 - warning
the
/request property's min was set to0.00 - warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- info
added the new optional request property
- info
added the new optional request property
/// - info
added the new optional request property
/// - info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added
subschema #1to therequest propertyanyOflist - info
added
subschema #1to therequest propertyanyOflist - info
added
subschema #1: Messagesto therequest propertyanyOflist - info
added
subschema #1: Responsemodalitiesto therequest propertyanyOflist - info
added
subschema #2to therequest propertyanyOflist - info
the request property
///became optional - info
the request property
///became optional - info
the
request property default valuefalsewas added - info
the
request property default valuetruewas added - info
the
request property default value0was added - info
the
request property default valuefalsewas added - info
the
request property default value1was added - info
the
request property default valuetruewas added - info
the
request property default value0was added - info
the
request property default valuemediumwas added - info
the
request property default valueautowas added - info
the
request property default value<|endoftext|>was added - info
the
request property default valuefalsewas added - info
the
request property default value1was added - info
the
request property default valueautowas added - info
the
request property default value1was added - info
the
request property default valuedisabledwas added - info
the
request property default valueenabledwas added - info
the
request property default valuemediumwas added - info
added discriminator to
/request property - info
added the new
flexenum value to the request property/ - info
added the new
minimalenum value to the request property/ - info
added the new
noneenum value to the request property/ - info
added the new
priorityenum value to the request property/ - info
added the new
scaleenum value to the request property/ - info
added the new
standard_onlyenum value to the request property/ - info
request property
list-of-types was widened by adding typesstringto media typeapplication/json - info
request property
list-of-types was widened by adding typesnullto media typeapplication/json - info
added to the
/request propertyoneOflist - info
mapped value for discriminator key
customchanged from to for////response property for the response status - info
mapped value for discriminator key
functionchanged from to for////response property for the response status - info
response property
choices/items/message/contentlist-of-types was narrowed by removing typesarrayfrom media typeapplication/jsonof response200 - info
removed from the
////response propertyoneOflist for the response status
- breaking