curl --request POST \
--url https://api.lighton.ai/api/v2/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "alfred-4.2"
}
'{
"model": "alfred-4.2",
"prompt": "Hello, "
}Models
Generate a text completion
deprecated
Deprecated — this endpoint will be removed in a future release. Use POST /api/v3/chat/completions instead.
This endpoint can be used to generate completions from a Large Language Model.
It is a simple proxy forwarding your requests to the desired model.
Any LightOn model is deployed on a vLLM-based image.
Response Types:
- When
stream=false(default): Returns a complete JSON response with all completion choices - When
stream=true: Returns Server-Sent Events (SSE) with incremental completion chunks
Streaming Format:
Each SSE event contains a JSON object with incremental text. The stream ends with data: [DONE].
POST
/
api
/
v2
/
completions
curl --request POST \
--url https://api.lighton.ai/api/v2/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "alfred-4.2"
}
'{
"model": "alfred-4.2",
"prompt": "Hello, "
}Authorizations
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Request serializer for completions endpoint (OpenAI-compatible).
Response
200 - application/json
Response serializer for completions endpoint results.