Appearance
Getting Started
Integrating Vortik into your project is designed to be effortless. Whether you're starting fresh or migrating an existing app, you'll be up and running in minutes.
1. Get an API Key
First, log in to the Vortik Dashboard and create a new project. From there, navigate to API Keys and click generate.
TIP
Store your API key securely. You'll need it to authenticate any requests hitting the Vortik Gateway.
2. Update your Configuration
If you're already using the OpenAI SDK, you're halfway there. To route traffic through Vortik, just override the baseURL and supply your apiKey.
javascript
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'YOUR_VORTIK_API_KEY',
baseURL: 'https://eu.gateway.vortik.ai/v1',
});
const response = await openai.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello, Vortik!' }],
});
console.log(response.choices[0].message.content);python
from openai import OpenAI
client = OpenAI(
api_key="YOUR_VORTIK_API_KEY",
base_url="https://eu.gateway.vortik.ai/v1"
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello, Vortik!"}]
)
print(response.choices[0].message.content)csharp
using OpenAI.Chat;
ChatClient client = new(
model: "gpt-4",
apiKey: "YOUR_VORTIK_API_KEY",
options: new OpenAIClientOptions {
Endpoint = new Uri("https://eu.gateway.vortik.ai/v1")
}
);
ChatCompletion completion = client.CompleteChat("Hello, Vortik!");
Console.WriteLine(completion.Content[0].Text);php
<?php
// Use the official OpenAI PHP client
$client = OpenAI::factory()
->withApiKey('YOUR_VORTIK_API_KEY')
->withBaseUri('https://eu.gateway.vortik.ai/v1')
->make();
$response = $client->chat()->create([
'model' => 'gpt-4',
'messages' => [
['role' => 'user', 'content' => 'Hello, Vortik!'],
],
]);
echo $response->choices[0]->message->content;bash
curl "https://eu.gateway.vortik.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_VORTIK_API_KEY" \
-d '{
"model": "gpt-4",
"messages": [
{"role": "user", "content": "Hello, Vortik!"}
]
}'http
POST https://eu.gateway.vortik.ai/v1/chat/completions
Content-Type: application/json
Authorization: Bearer YOUR_VORTIK_API_KEY
{
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "Hello, Vortik!"
}
]
}3. Verify in the Dashboard
Once you make your first request, head over to the Requests Log in the Vortik Dashboard. You should see your request pop up in real-time with full details:
- Request and response body
- Token usage and estimated cost
- Latency and performance metrics
- Provider status
Next Steps
Now that you're connected, check out these advanced features: