API reference
API reference
Endpoint schemas rendered from the bundled Kisch OpenAPI document.
Explore request bodies, responses and authentication for the inference API. The playground sends requests from your browser to the selected API server using your virtual key.
GET
BearerAuthheader
AuthorizationBearer <LiteLLM virtual key>Models visible to this key.
application/json- response
object*unknowndata*array<>curl -X GET 'http://localhost:4000/v1/models'Example Response
{ "object": "list", "data": []}POST
BearerAuthheader
AuthorizationBearer <LiteLLM virtual key>application/json- body
model*stringAn alias currently returned by GET /v1/models.
messages*array<>Items
1 <= itemsstream?booleanDefault
falsetemperature?numberRange
0 <= value <= 2top_p?numberRange
0 <= value <= 1max_tokens?integerSome deployments may instead expose max_completion_tokens. Confirm the active model's runtime contract.
Range
1 <= valuestop?string|array<string>A completion response or, when stream is true, a Server-Sent Events stream.
- response
id*stringobject*unknowncreated?integermodel?stringchoices*array<>usage?curl -X POST 'http://localhost:4000/v1/chat/completions' \ -H 'Content-Type: application/json' \ -d '{ "model": "model-id-returned-by-v1-models", "messages": [ { "role": "user", "content": "Say hello in five words." } ], "stream": false}'Example Response
{ "id": "string", "object": "chat.completion", "created": 0, "model": "string", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "string" }, "finish_reason": "string" } ], "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0 }}POST
BearerAuthheader
AuthorizationBearer <LiteLLM virtual key>application/json- body
model*stringAn alias currently returned by GET /v1/models.
input*stringPlain text input; array and multimodal input are outside this contract.
stream?booleanDefault
falsemax_output_tokens?integerRange
1 <= valuetemperature?numberRange
0 <= value <= 2top_p?numberRange
0 <= value <= 1A text response or, when stream is true, a Server-Sent Events stream.
- response
id*stringobject*unknowncreated_at?integerstatus*stringmodel?stringoutput*array<>output_text?stringcurl -X POST 'http://localhost:4000/v1/responses' \ -H 'Content-Type: application/json' \ -d '{ "model": "model-id-returned-by-v1-models", "input": "Say hello in five words.", "stream": false}'Example Response
{ "id": "string", "object": "response", "created_at": 0, "status": "string", "model": "string", "output": [ {} ], "output_text": "string"}