API Endpoints

Create custom API endpoints to integrate your AI configurations into applications, websites, and services. Each endpoint provides a unique URL that proxies requests to your configured AI.


What are Endpoints?

An endpoint is a custom API URL that routes requests to your AI configuration. Instead of exposing your raw AI provider credentials, endpoints provide:

  • A unique, shareable API URL
  • Built-in token authentication
  • Rate limiting controls
  • Usage tracking and analytics
  • Consistent behavior from your configuration's training

Creating an Endpoint

  1. Open your configuration's detail page
  2. Click Add Endpoint
  3. Fill in the details:
    • Name: A descriptive name (e.g., "Production API")
    • Description: Optional notes about the endpoint's purpose
    • Rate Limit: Maximum requests allowed (optional)
    • Require Token: Whether authentication is required
  4. Click Create Endpoint

Endpoint URL

Each endpoint gets a unique URL in the format:

https://configuremyai.com/api/v1/[endpoint-path]

The endpoint path is auto-generated but can be customized. Share this URL with your application to make AI requests.

Making Requests

Endpoint requests follow the OpenAI API format for chat completions:

Request Format

POST /api/v1/[endpoint-path]
Content-Type: application/json
Authorization: Bearer [your-token]  # If token required

{
  "messages": [
    {"role": "user", "content": "Hello, how can you help me?"}
  ]
}

Response Format

{
  "id": "unique-id",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm here to help..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 50,
    "total_tokens": 75
  }
}

cURL Example

curl -X POST https://configuremyai.com/api/v1/abc123 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cmai_your_token_here" \
  -d '{
    "messages": [
      {"role": "user", "content": "What can you help me with?"}
    ]
  }'

Endpoint Settings

Setting Description
Name Display name for the endpoint
Description Optional notes (not exposed in API)
Active Toggle to enable/disable the endpoint
HTTP Method POST (default for chat completions)
Rate Limit Maximum total requests (leave empty for unlimited)
Require Token Whether requests need authentication

Usage Statistics

Each endpoint tracks:

  • Total Calls: Number of requests made
  • Last Called: Timestamp of most recent request
  • Active Tokens: Number of authentication tokens

View statistics on the endpoint's detail page.

Error Handling

Endpoints return standard HTTP error codes:

Code Description
401 Unauthorized - Invalid or missing token
404 Not Found - Endpoint doesn't exist or is inactive
429 Too Many Requests - Rate limit exceeded
500 Internal Error - AI provider error or configuration issue

Error responses include a JSON body with details:

{
  "error": {
    "message": "Rate limit exceeded",
    "type": "rate_limit_error"
  }
}