Docs/Chat

Create a chat response

Generate a streamed reply.

POSThttps://api.vaelor.chat/v1/chat

Generates a reply to text, optionally with earlier turns in context and files in attachments. The reply is streamed as plain text. Vaelor is stateless here: send the conversation history you want the model to see on every request.

Body#

textstringRequired

The user's message. Up to 100,000 characters.

attachmentsobject[]Required

Files the model should read, up to 10. Pass an empty array for none. Upload files first with Upload a file.

namestringRequired
File name shown to the model.
mediaTypestringRequired
MIME type, such as application/pdf or image/png.
urlstringRequired
The file's url from the upload response.
configobjectRequired

Model settings.

modelenumRequired
One of flash, medium or high. See Models.
modesenum[]Required
Zero or more of reasoning and deep-research.
uncensoredbooleanRequired
Route to the uncensored model. See Uncensored mode.
contextobject[]

Earlier turns, oldest first. Each item has a role of user or assistant and a content string. Counted as input tokens.

usageRequestIduuid

Ties the charge to a reservation you created earlier. See Idempotency.

sourceIdstring

Your own identifier for the conversation, up to 120 characters. Shown in your usage activity.

Response#

A text/plain stream containing the reply. The response includes these headers:

x-vaelor-usage-request-idheader

The usage record for this response. The final charge is settled when the stream ends.

Example#

curl -N https://api.vaelor.chat/v1/chat \
  -H "Authorization: Bearer $VAELOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Now make it a checklist.",
    "attachments": [],
    "context": [
      { "role": "user", "content": "Plan a 3-day trip to Lisbon under $600, no car." },
      { "role": "assistant", "content": "Day 1: Alfama and the castle..." }
    ],
    "config": { "model": "medium", "modes": [], "uncensored": false }
  }'

Response200

Text
**Lisbon in 3 days — checklist**

Day 1 · Alfama
- [ ] Tram 28 to Graça (€3.10)
- [ ] São Jorge Castle (€15)
- [ ] Fado dinner in Alfama
...

Attachments#

Images are read with vision; PDFs, Word files and spreadsheets are converted to text. Parsing documents is billed as tool calls.

JSON
{
  "text": "What is the total on this invoice?",
  "attachments": [
    { "name": "invoice-0042.pdf", "mediaType": "application/pdf", "url": "https://files.vaelor.chat/…" }
  ],
  "config": { "model": "flash", "modes": [], "uncensored": false }
}

Billing#

1 credit is reserved when the request arrives. When the stream ends, the charge is settled from the tokens used at the tier's rates. If the client disconnects before any output, the reservation is refunded.

Errors#

StatusWhen
400The body failed validation.
402Not enough credits for the 1-credit reservation.
502The model provider failed. Safe to retry.
503Chat is temporarily unavailable.

Was this page helpful?

Questions? Contact support

Last updated October 20, 2026