✨Quick Start
Introduction
Our RESTful API is designed to be simple, efficient, and developer-friendly. This guide will help you quickly understand how to start integrating our services into your applications using standard HTTP conventions.
Simple API requests
Our API uses only the two most common HTTP methods to keep things simple:
GET
: Retrieve data from the serverPOST
: Send data to the server
Essential Headers
All requests should include the following headers:
Content-Type
:application/json
Authorization
:Bearer {api_key}
Authentication
Interacting with the API requires a Bearer token for authorization:
Example:
Authorization: Bearer sk-abc123yourapikey
You can generate API keys from your organization settings. Tokens are tied to your organization and rate-limited per key.
Formatting
When sending GET
requests, include your data as query parameters. Here's a quick example:
https://api.secton.org/v1/models?category=chat&sort=name
However, when sending POST
requests, format your data as JSON:
{
"model": "copilot-zero",
"messages": [
{ "role": "user", "content": "Tell me a joke" }
],
"temperature": 0.8
}
All responses are in JSON, providing a predictable structure for handling data. Here’s a sample response:
{
"object": "chat.completion",
"model": "copilot-zero",
"organization_id": "org_12345678",
"messages": [
{ "role": "user", "content": "Tell me a joke" },
{ "role": "assistant", "content": "Why don't skeletons fight each other? They don't have the guts." }
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 16,
"total_tokens": 28
}
}
Rate Limiting
To ensure fair usage, our API enforces rate limits per organization and API key. If you hit the limit, you’ll receive a 429 Too Many Requests
response.
Rate limits reset automatically after a short cooldown period.
By following these steps, you’ll see just how easy it is to integrate our services into your applications. For more detailed instructions, refer to the specific sections of our documentation.
Last updated
Was this helpful?