Run a chat-style text completion for captions, summaries, classification, or any short text task. The response returns immediately — no Jobs polling.
URL: POST https://api.thefluxtrain.com/api/v1/llm/chat-completion
Authentication: x-api-key
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
messages | object | Yes | — | At least one message |
messages[].role | string | Yes | — | system, user, or assistant |
messages[].content | string | Yes | — | Message text |
model | string | No | gpt-4o | OpenAI model name |
{
"model": "gpt-4o",
"messages": [
{ "role": "system", "content": "You write short product captions." },
{ "role": "user", "content": "Caption for a blue running shoe." }
]
}
| Field | Type | Description |
|---|---|---|
content | string | Model-generated text |
{
"data": {
"content": "Lightweight blue runners built for speed and comfort."
},
"error": null
}