Skip to main content

Assistants API

The Assistants API allows you to interact with AI assistants that can process messages, maintain conversation history, and provide specialized capabilities.

Capabilities

  • Message Processing: Send messages and receive AI responses
  • Chat History: Maintain and retrieve conversation history
  • Specializations: Use different assistant configurations for different use cases
  • Custom Models: Override LLM provider and model per request
  • Tagging: Organize conversations with tags

Key Concepts

Assistant Specialization

Assistant Specializations define how an assistant behaves, what tools it can use, and how it processes messages.
PropertyDescription
identifierUnique identifier used in API paths
nameDisplay name
presetsSystem prompt / instructions
availableToolsGroupsUidsTool group IDs the assistant can use
model / providerDefault LLM configuration
accessConfigurationVisibility and external access settings

Chat History

Conversations are stored and can be continued by providing a chatUid:
{
  "chatUid": "chat-123",
  "messages": [
    { "role": "user", "content": "Hello" },
    { "role": "assistant", "content": "Hi! How can I help?" }
  ]
}

Endpoints Summary

MethodEndpointDescription
GET/api/v1/assistantsList all assistant specializations
GET/api/v1/assistants/:identifierGet specific assistant
POST/api/v1/assistants/:identifier/messagesSend message to assistant
GET/api/v1/assistants/:identifier/chatsList chat histories
GET/api/v1/assistants/:identifier/chats/:chatUidGet specific chat
POST/api/v1/assistants/chatsGet all chats with filters
GET/api/v1/assistants/tagsGet unique tags

Example: Send a Message

curl -X POST "https://api.devic.ai/api/v1/assistants/default/messages" \
  -H "Authorization: Bearer devic-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Explain the concept of recursion in programming",
    "chatUid": "chat-123",
    "tags": ["programming", "education"]
  }'

Response

{
  "success": true,
  "data": [
    {
      "role": "user",
      "content": "Explain the concept of recursion in programming"
    },
    {
      "role": "assistant",
      "content": "Recursion is a programming concept where a function calls itself..."
    }
  ]
}

Example: Custom Model

Override the default LLM for a specific request:
curl -X POST "https://api.devic.ai/api/v1/assistants/default/messages" \
  -H "Authorization: Bearer devic-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Write a haiku about programming",
    "provider": "anthropic",
    "model": "claude-3-opus-20240229"
  }'

Example: List Chat Histories

curl -X GET "https://api.devic.ai/api/v1/assistants/default/chats?limit=20" \
  -H "Authorization: Bearer devic-your-api-key"

Supported Providers

When sending messages, you can specify custom providers and models:
ProviderDescription
openaiOpenAI API
anthropicAnthropic API
azureAzure OpenAI
googleGoogle AI (Gemini)
Note: The provider must be configured in your account settings before use.

Access Configuration

Control visibility and external API access:
{
  "accessConfiguration": {
    "externalAccess": true,
    "visibilityByRole": ["admin", "user"]
  }
}
  • externalAccess: true - Makes the assistant available via the public API
  • visibilityByRole - Controls which user roles can see/use the assistant

See Also