Documentation

API Documentation

Full endpoint examples, SDK snippets, streaming responses, and Claude Code setup.

API Endpoint

Base URL: https://api.ecomagent.in/v1

Replace YOUR_API_KEY with your actual API key from your dashboard.

cURL Example

Make API requests directly from your terminal using cURL.

Basic Chat Completion

#!/usr/bin/env sh

BASE_URL="https://api.ecomagent.in/v1"
API_KEY="YOUR_API_KEY"

curl "$BASE_URL/chat/completions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4.6",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
bash

With Streaming

# With streaming
curl "$BASE_URL/chat/completions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4.6",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ],
    "stream": true
  }'
bash

Expected Output

{
  "choices": [
    {
      "finish_reason": "stop",
      "message": {
        "content": "Hello! How are you doing today? Is there something I can help you with?",
        "role": "assistant"
      }
    }
  ],
  "created": 1769095572,
  "id": "msg_vrtx_01XNdd65BAkT82dLgksZGWD3",
  "usage": {
    "completion_tokens": 20,
    "prompt_tokens": 9,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "total_tokens": 29
  },
  "model": "claude-opus-4.6"
}
json

Additional Resources

API Keys

Generate and manage your API keys securely.

Manage Keys ->

Usage Stats

Monitor your API usage and costs.

View Usage ->