AI Commons

Getting Started

Welcome to AI Commons API

The AI Commons API provides access to state-of-the-art language models including Claude, Llama, Mistral, and Amazon Nova models through a simple, unified interface.

Quick Start

1

Get Your API Key

Contact the AI Commons team to obtain your API key and endpoint URL.

2

Send a POST Request

Create a conversation by sending a POST request to /conversation with your message.

3

Poll for Response

Use the GET /conversation/{id} endpoint to retrieve the AI response.

4

Continue the Conversation

Send follow-up messages using the conversation ID for multi-turn interactions.

Basic Example

curl -X POST <your-api-url>/conversation \
  -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "message": {
      "role": "user",
      "content": [
        {
          "content_type": "text",
          "body": "Explain quantum computing"
        }
      ],
      "model": "claude-v4.6-sonnet"
    }
  }'

Core Concepts

Asynchronous Processing

The API uses async processing. After creating a conversation, poll the GET endpoint to retrieve responses.

Message Threading

Messages are linked using parent_message_id to maintain conversation context automatically.

Content Types

Support for text, images, attachments, tool use, and reasoning content in messages.

Model Selection

Choose from multiple models optimized for different use cases - from quick responses to complex reasoning.

Next Steps