CanalAPI

Getting Started

Create an account, get an API key, and send your first request to CanalAPI.

This guide walks you through the minimum steps needed to send your first request through CanalAPI.

1. Create an account

  1. Open the CanalAPI console at https://www.canalapi.com.
  2. Sign up with email and password, or with a supported third-party identity provider.
  3. Verify your email if prompted.

2. Create an API key

  1. In the console, open API Keys.
  2. Click Create new key.
  3. Give the key a recognizable name (for example, local-dev or production).
  4. Copy the key and store it somewhere safe — you will only see it once.

Treat API keys like passwords. Do not commit them to source control, and do not embed them in client-side JavaScript that ships to browsers or mobile devices.

3. Set the Base URL

CanalAPI is OpenAI-compatible. You can reuse the official OpenAI SDKs by overriding the baseURL and the API key.

export CANALAPI_BASE_URL="https://api.canalapi.com/v1"
export CANALAPI_API_KEY="sk-..."

The exact production Base URL is shown in your console. If you operate in a region with restricted egress, refer to the console for the recommended URL for your account.

4. Send your first request

curl "$CANALAPI_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $CANALAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Say hi in one short sentence."}
    ]
  }'

A successful response looks like:

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1730000000,
  "model": "gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {"role": "assistant", "content": "Hi there!"},
      "finish_reason": "stop"
    }
  ],
  "usage": {"prompt_tokens": 18, "completion_tokens": 4, "total_tokens": 22}
}

5. Next steps

On this page