Assistant API
Creates a model response for a given Assistant.
Creates a model response for a given assistant id, or pass in an Assistant configuration that should be used for your request.
To use the API you need an API key. You can create API Keys in your Workspace settings. If you want to interact with an existing Assistant, make sure to “Share” access to the assistant with the created API Key (Assistants > Your Assistant > Share).
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
assistantId | string | One of assistantId/assistant required | ID of an existing assistant to use |
assistant | object | One of assistantId/assistant required | Configuration for a new assistant |
messages | array | Yes | Array of message objects with role and content |
Assistant Configuration
When creating a temporary assistant, you can specify:
name
(required) - Name of the assistant (max 64 chars)instructions
(required) - System instructions (max 16384 chars)description
- Optional description (max 256 chars)temperature
- Temperature between 0-1model
- Model ID to use (see Available Models for options)capabilities
- Enable features like web search, data analysis, image generationactions
- Custom API integrationsvectorDb
- Vector database connectionsknowledgeFolderIds
- IDs of knowledge folders to use
You can retrieve a list of available models using the Models API. This is useful when you want to see which models you can use in your assistant configuration.
Examples
Using an Existing Assistant
Using a temporary Assistant configuration
Rate limits
The rate limit for the Assistant Completion endpoint is 500 RPM (requests per minute) and 60.000 TPM (tokens per minute). Rate limits are defined at the workspace level - and not at an API key level. Each model has its own rate limit. If you exceed your rate limit, you will receive a 429 Too Many Requests
response.
Please note that the rate limits are subject to change, refer to this documentation for the most up-to-date information. In case you need a higher rate limit, please contact us at support@langdock.com.
Response Format
The API returns an array of results, where each result contains:
Error Handling
Body
ID of an existing assistant to use
Response
Was this page helpful?