Chasm API Documentation

Chasm API Documentation

Welcome to the Chasm API documentation. This guide provides all the information you need to start using our OpenAI-compatible API endpoint. Whether you're a public user or a Scout member with an API key, this documentation will help you understand how to interact with the Chasm Orchestrator effectively.

Introduction

The Chasm API allows developers to integrate advanced language processing capabilities into their applications. Our API is designed to be compatible with OpenAI's API, making it easy to switch or integrate alongside existing solutions.

API Endpoint:

https://orchestrator.chasm.net/v1/chat/completions

Getting Started

Public Access

Public users can start using the API immediately without any authentication. However, public access is subject to rate limits to ensure fair usage.

Public Rate Limits:

  • 10 requests per minute

  • 100 requests per day

API Key Access

For higher usage needs, users can obtain an API key by becoming a Scout member. With an API key, you benefit from increased rate limits.

API Key Rate Limits:

  • 100 requests per minute

  • 5,000 requests per day

Authentication

Using an API Key

To authenticate your requests using an API key, include the following header in your HTTP requests:

Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key generated from your Scout account.

Without an API Key

If you're using the API without an API key, no additional headers are required. Simply make your requests to the endpoint, keeping in mind the public rate limits.

Rate Limits

Rate limits are enforced to maintain the quality of service for all users.

Public Users

  • 10 requests per minute

  • 100 requests per day

API Key Holders (Scout Members)

  • 100 requests per minute

  • 5,000 requests per day

Generating and Managing API Keys

Generating an API Key

  1. Log in to your Scout account at scout.chasm.net.

  2. Navigate to the API Keys section in your account dashboard.

  3. Click on Generate New API Key.

  4. Copy the generated API key. Note: This is the only time the full key will be displayed. Store it securely.

Removing an API Key

  1. In the API Keys section, locate the API key you wish to remove.

  2. Click on the Delete button next to the key.

  3. Confirm the action when prompted.

Making API Requests

Request Structure

Send a POST request to the API endpoint with the required headers and JSON body.

Endpoint:

https://orchestrator.chasm.net/v1/chat/completions

Headers:

  • Content-Type: application/json

  • Authorization: Bearer YOUR_API_KEY (only if using an API key)

Request Body Example

{
  "model": "gemma2-9b-it",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Can you tell me a joke?"}
  ]
}

Response Example

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1700000000,
  "model": "gemma2-9b-it",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Why did the computer show up at work late? It had a hard drive!"
      },
      "finish_reason": "stop"
    }
  ]
}

Error Handling

Rate Limit Exceeded

If you exceed your rate limits, the API will return a 429 Too Many Requests error.

Response Example:

{
  "error": {
    "message": "Rate limit exceeded. Try again later.",
    "type": "rate_limit_exceeded",
    "code": 429
  }
}

Unauthorized Access

If you provide an invalid API key or access a restricted resource, you'll receive a 401 Unauthorized error.

Response Example:

{
  "error": {
    "message": "Invalid API key.",
    "type": "authentication_error",
    "code": 401
  }
}

Last updated