Try It
Test the AI Commons API endpoints interactively. Enter your API credentials once, and they'll be saved in your browser for convenience.
Note: Your API credentials are stored only in your browser's localStorage and are never sent to any server other than your own API endpoint.
GET /models
Retrieve a list of all available models in your AI Commons instance.
Endpoint Details:
- Method: GET
- Path:
/models - Authentication: Bearer token required
Example Response:
{
"models": [
{
"id": "claude-v4.6-opus",
"name": "Claude 4.6 Opus",
"provider": "anthropic",
"context_length": 200000
},
{
"id": "claude-v4.6-sonnet",
"name": "Claude 4.6 Sonnet",
"provider": "anthropic",
"context_length": 200000
},
{
"id": "amazon-nova-pro",
"name": "Amazon Nova Pro",
"provider": "amazon",
"context_length": 300000
}
]
}
POST /conversations
Create a new conversation and send a message to the AI.
Endpoint Details:
- Method: POST
- Path:
/conversations - Authentication: Bearer token required
- Content-Type: application/json
Coming Soon: Interactive POST request testing is under development.
Example Request:
{
"message": {
"content": [{
"content_type": "text",
"body": "Hello, how are you?"
}],
"model": "claude-v4.6-sonnet"
},
"temperature": 0.7,
"max_tokens": 1000
}
Example Response:
{
"conversation_id": "conv_123abc",
"message_id": "msg_456def",
"content": [{
"content_type": "text",
"body": "Hello! I'm doing well, thank you for asking. How can I assist you today?"
}],
"model": "claude-v4.6-sonnet",
"usage": {
"input_tokens": 12,
"output_tokens": 23
}
}
Troubleshooting
Common Issues:
CORS Error
If you see a CORS error, your API endpoint may need to allow requests from this origin. Contact your API administrator.
401 Unauthorized
Check that your API key is correct and properly formatted. It should start with your key prefix (e.g., sk-).
404 Not Found
Verify your Base URL is correct and includes the full path to your API (including version, e.g., /v1).
Network Error
Ensure your API endpoint is accessible and your network allows outbound requests to it.