API Documentation
Learn how to integrate and use our API in your applications.
API Documentation
This guide explains how to integrate and use our API in your applications. You'll find detailed documentation on authentication, available endpoints, and code examples.
Quick Start
Base URL
Your API base URL is your application endpoint. This is where all API requests will be sent.
https://your-app-endpoint.example.com
Authentication
All API requests require authentication using an API key in the Authorization header.
Authorization: Bearer YOUR_API_KEY
To obtain your API key, go to your application settings in the dashboard.
Chat APIs
Chat Completion
Create a chat completion for the provided messages. Returns the AI's response based on the conversation context.
Endpoint: POST /api/v1/completions
Status: Stable
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
model | string | Yes | ID of the model to use |
messages | array | Yes | Array of messages in the conversation |
temperature | number | No | Sampling temperature between 0 and 2 |
max_tokens | integer | No | Maximum number of tokens to generate |
Code Examples
curl https://your-app-endpoint.example.com/api/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "llama3",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"top_p": 0.7,
"max_tokens": 1024
}'
Feedback APIs
Like Message
Submit positive feedback for a chat message. Use this to indicate helpful or accurate responses.
Endpoint: POST /api/v1/chat/like
Status: Beta
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
message_id | string | Yes | The ID of the message to like |
conversation_id | string | Yes | The ID of the conversation containing the message |
feedback_note | string | No | Additional feedback note or comment |
Code Examples
curl https://your-app-endpoint.example.com/api/v1/chat/like \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"message_id": "msg_123",
"conversation_id": "conv_456",
"feedback_note": "Very helpful response!"
}'