Chat with a model
Send a conversation to a model through the gateway, as the AI tool's chat does (developer role). It is free while the caller's account is within its AI allowance (60 answers an hour, shared with Ask AI) and the request's worst case costs at most $0.25 (output is capped to fit), and charged to the caller's usage balance otherwise; with `keyId` the key's models, budget and rate limit apply. With `Accept: text/event-stream` the reply streams as a `start` event naming the model and provider that answer (`fallback` when an alias moved on), then `delta` events (`{type, text}`), and ends with a `done` event carrying the usage, or an `error` event; otherwise it answers once with the whole reply.
Authorization
cloady Personal API token (cldy_…)
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/ai/chat" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "messages": [ { "role": "user", "content": "string" } ] }'{ "text": "string", "usage": { "model": "string", "provider": "string", "input": 0, "output": 0, "micros": 0, "charged": 0, "ms": 0 }}Read a logged prompt GET
The prompt and response kept for one request of the log, when prompt logging was on (developer role). `at`, the entry's time from listAiLogs, narrows the search; without it the whole retention period is read.
List self-hosted model servers GET
The workspace's apps that serve models (Ollama, vLLM and the like), each with the models it serves, read from the running server.