Docs / Platform / API & embedding
API & embedding
Call your agents programmatically, embed the chat widget on your site, or connect over webhook. Below are the essentials to get going.
Authentication
Create an API key from Settings → API keys and send it as a bearer token on every request.
curl https://api.1clic.ai/v1/agents \
-H "Authorization: Bearer $TOKEN"Run an agent
POST a message to an agent to get a response. Runs are billed against your token balance at the standard rate.
curl https://api.1clic.ai/v1/agents/"nova"/chat \
-H "Authorization: Bearer $TOKEN" \
-d '{ "message": "Help a customer with a refund." }'Embed the widget
Drop the widget script anywhere in your site's HTML and point it at an agent:
<script src="https://1clic.ai/widget.js"
data-agent="nova"></script>Errors & rate limits
The API uses standard HTTP status codes — 401 for a bad key, 429 when you exceed your rate limit, 402 when your token balance is exhausted. Error bodies include a message field.
📓
Full endpoint reference coming soon. The complete list of endpoints (tasks, run history, webhooks) is being migrated into these docs.