/v1/chat/completionshttps://api.linkinfra.aiAuthorization
Bearer TokenAuthorizationBearer <token>Authenticate requests with your API key in the request header:
Authorization: Bearer sk-your-api-keyNeed a key? Create one in the console
Request body
application/jsonmodelstringrequiredModel ID from the model catalog. Availability depends on your account group and configured channels.
messagesarray<object>requiredAn ordered list of conversation messages.
Show child properties2
rolestringrequiredMessage role, such as system, user, or assistant.
contentstring | arrayrequiredText or multimodal content blocks. Supported content depends on the model.
streambooleanSet to true to receive incremental Server-Sent Events. Defaults to false.
temperaturenumberSampling temperature, typically 0–2. Supported values depend on the model.
max_completion_tokensintegerUpper limit for generated tokens. Check that the model supports this parameter.
toolsarray<object>Definitions of tools the model may call.
Show child properties2
typestringrequiredTool type. Use function for function tools.
functionobjectrequiredFunction name, description, and parameters (JSON Schema).
response_formatobjectOutput format, for example {"type":"json_object"}. Requires model support.
Set stream to true and read choices[0].delta.content from each data: event until data: [DONE]. With cURL, add -N to disable output buffering.
Response
application/json200Successful responseidstringUnique identifier for the completion.
choicesarray<object>Generated choices. Text is in message.content.
usageobjectToken usage for this request. Check usage logs in the console for actual charges.