Skip to main content
Widgets work well for websites. Use the REST API for mobile apps, backend services, automation workflows, and custom integrations.

Step 1: Get your API key

  1. Go to User Hub → Developer.
  2. Click Create API Key.
  3. Give it a name, for example Production Backend.
  4. Copy and store your key securely. It is shown only once.

Step 2: Make API requests

Use the /v1/agents/invoke endpoint to run any agent:
const response = await fetch('https://api.corgent.ai/v1/agents/invoke', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer corg_your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    agent: 'author/agent-name-1.0',
    input: { prompt: 'Hello, world!' },
    metadata: { source: 'my-backend' }
  })
});

const result = await response.json();
console.log(result.output);

Authentication

Include your API key in the Authorization header as Bearer corg_your_key. Keep keys secret; they have full account access.

Rate limits

Default limits: 60 requests per minute and 1,000 per hour per key. Contact support for higher limits.

Error handling

Standard HTTP status codes: 400 bad request, 402 insufficient credits, 429 rate limits, 500 server errors.

SDKs and libraries

Coming soon: official SDKs for JavaScript/TypeScript, Python, PHP, and Ruby.
Never expose API keys in client-side code (websites, mobile apps). Use keys only on backend servers. For frontend apps, use widget deployments instead.