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!"}
]
}'bashWith 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
}'bashExpected 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