Chat Completions API
Chat Completions Streaming API
OpenAI Compatible Endpoint
Overview
Base URL
https://insight.lineupiq.io/v1/chat/completions
Authentication
Header | Description | Required |
---|---|---|
x-api-key | Your API key for authentication | Yes |
x-app-id | Your application ID | Yes |
Content-Type | Must be application/json | Yes |
Request Format
HTTP Method
POST
Request Body
{
"model": "control-4v1",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant specializing in music industry knowledge."
},
{
"role": "user",
"content": "I'm looking for venues in Edmonton that can host a rock concert."
}
],
"stream": true
}
Parameters
Parameter | Type | Description | Required | Default |
---|---|---|---|---|
model | string | ID of the model to use (e.g., 'control-4v1', 'discovery-pulse-4v1') | Yes | - |
messages | array | A list of messages comprising the conversation so far | Yes | - |
messages[].role | string | The role of the message author (system, user, or assistant) | Yes | - |
messages[].content | string | The content of the message | Yes | - |
stream | boolean | Whether to stream the response (recommended) | No | true |
Response Format
text/event-stream
. Each event starts with data:
followed by a JSON string and two newlines.Successful Response (200 OK)
1.
data: {"choices": [{"delta": {"role": "assistant", "content": "Hello"}, "index": 0, "finish_reason": null}]}\n\n
2.
data: {"choices": [{"delta": {"content": ", I am your assistant"}, "index": 0, "finish_reason": null}]}\n\n
3.
data: {"choices":[{"delta":{},"finish_reason":"stop","index":0}]}\n\n
4.
data: [DONE]\n\n
Error Responses
Authentication Errors (401 Unauthorized)
{
"detail": "API key missing. Provide it via X-API-Key header or Bearer token"
}
{
"detail": "Invalid API key"
}
{
"error": {
"message": "Authentication required",
"type": "authentication_error",
"param": null,
"code": "invalid_request_error"
}
}
In-Stream Errors
data: {"error": {"message": "An internal server error occurred", "type": "server_error", "param": null, "code": "internal_error"}}\n\n
Client Implementation
JavaScript Example
Python Example
Rate Limits
Plan | Requests per minute | Tokens per minute |
---|---|---|
Free | TBD | TBD |
Basic | TBD | TBD |
Pro | TBD | TBD |
Enterprise | Custom | Custom |
Models
Model ID | Description | Context Window | Use Case |
---|---|---|---|
discovery-pulse-4v1 | Research-focused AI assistant | 32K tokens | Deep research, complex queries |
Best Practices
1.
stream: true
for the best user experience, allowing content to appear incrementally.2.
messages
array to maintain context.3.
4.
5.