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. Each run's tokens are charged to your wallet at the provider's published rate; the response carries usage and cost_usd.
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 the wallet is empty or the workspace has no live bridge, 403 when the agent is still in sandbox. 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.