Quickstart
Get up and running with Consus Gateway in under 5 minutes.
Prerequisites
- An API key (provided by your account administrator)
- The OpenAI SDK for your language, or any HTTP client
1. Install the SDK
Python:
TypeScript/Node:
2. Configure the Client
Point the OpenAI SDK at your Consus Gateway endpoint and pass your API key via the x-api-key header.
Python:
from openai import OpenAI
client = OpenAI(
base_url="https://api.consus.io/v1",
api_key="dummy", # Required by SDK but not used for auth
default_headers={"x-api-key": "YOUR_API_KEY"},
)
TypeScript:
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.consus.io/v1',
apiKey: 'dummy',
defaultHeaders: { 'x-api-key': 'YOUR_API_KEY' },
});
3. Make a Request
Python:
completion = client.chat.completions.create(
model="claude-3-7-sonnet",
messages=[{"role": "user", "content": "Hello!"}],
)
print(completion.choices[0].message.content)
TypeScript:
const completion = await client.chat.completions.create({
model: 'claude-3-7-sonnet',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(completion.choices[0].message.content);
curl:
curl -X POST https://api.consus.io/v1/chat/completions \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-7-sonnet",
"messages": [{"role": "user", "content": "Hello!"}]
}'
What's Next
- Authentication - How API keys work, rate limits, and error codes
- Chat Completions - Full request/response reference
- Models - Available models and their capabilities