Skip to main content

Overview

All API requests require authentication via Bearer tokens. This ensures secure and authorized access to your organization’s data.
Tokens are tied to your organization and are rate-limited per key.

Creating API Keys

To generate an API key:
  1. Go to your organization settings in the dashboard.
  2. Click Create API key on the top right.
  3. Enter a name and select a duration.
  4. Copy the token and store it securely.
Never expose your API key in public repositories or frontend code.

Using Bearer Tokens

Include your token in the Authorization header of every request:
Authorization: Bearer sk-abc123yourapikey

Examples

HTTP Request Example:
GET /v1/models HTTP/1.1
Host: api.secton.org
Authorization: Bearer sk-abc123yourapikey
Content-Type: application/json
cURL Example:
curl -H "Authorization: Bearer sk-abc123yourapikey" \
     -H "Content-Type: application/json" \
     https://api.secton.org/v1/models

Token Management

It’s a best practice to rotate your API keys periodically.
  1. Generate a new key.
  2. Update your environment variables.
  3. Revoke the old key.
To revoke a key:
  1. Go to organization settings
  2. Click the icon next to the key you want to disable, and then click on Delete API Key.

Common Issues

Ensure your token is correct, has no extra spaces, and is included in the Authorization header.
If your request returns 401 Unauthorized, check if the key was revoked or regenerated. Replace it with a valid key.
I