Quickstart
Get started with Onysoft AI Gateway
Onysoft AI Gateway is a unified platform that gives you access to hundreds of AI models through a single API. Because our API is compatible with the OpenAI SDKs, you can move your existing applications to the Onysoft infrastructure with a few lines of changes.
Pay in Turkish Lira: You top up and spend your balance in Turkish Lira; no foreign card is needed. Model prices are listed in USD; the cost of each request is converted to TRY at the current CBRT USD rate and deducted from your balance.
1. Create an API Key
First, create a free account and generate an API key from the Dashboard.
Security: Never use your API key in client-side (frontend) code. Store your key on the server side and manage it as an environment variable.
2. Make Your First API Call
The examples below show how to get started in your preferred programming language. The Onysoft API is compatible with the OpenAI SDKs: you only need to change the base_url value and the API key.
from openai import OpenAI
client = OpenAI(
api_key="sk-ony-your-api-key",
base_url="https://api.onysoft.com/v1"
)
response = client.chat.completions.create(
model="google/gemini-3.8-flash",
messages=[
{"role": "user", "content": "Merhaba, nasılsın?"}
]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-ony-your-api-key',
baseURL: 'https://api.onysoft.com/v1'
});
const response = await client.chat.completions.create({
model: 'google/gemini-3.8-flash',
messages: [
{ role: 'user', content: 'Merhaba, nasılsın?' }
]
});
console.log(response.choices[0].message.content);
$ch = curl_init('https://api.onysoft.com/v1/chat/completions');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer sk-ony-your-api-key',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'google/gemini-3.8-flash',
'messages' => [
['role' => 'user', 'content' => 'Merhaba, nasılsın?']
]
])
]);
$response = json_decode(curl_exec($ch), true);
echo $response['choices'][0]['message']['content'];
curl https://api.onysoft.com/v1/chat/completions \
-H "Authorization: Bearer sk-ony-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.8-flash",
"messages": [
{"role": "user", "content": "Merhaba, nasılsın?"}
]
}'
3. Response Format
A successful request returns a response in the following format:
{
"id": "req_a1b2c3d4e5f6a1b2c3d4e5f6",
"object": "chat.completion",
"created": 1706000000,
"model": "google/gemini-3.8-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Merhaba! Ben bir AI asistanıyım, size nasıl yardımcı olabilirim?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 24,
"total_tokens": 36
},
"cost": {
"amount": 0.000024,
"currency": "USD"
},
"success": true,
"data": { /* backward compatibility: the same fields as above (id, object, created, model, choices, usage, cost) */ }
}
In non-streaming responses the OpenAI fields (id, choices, usage …) are at the top level, so the official OpenAI SDKs and libraries such as LangChain read response.choices[0].message.content directly. For backward compatibility the response also carries "success": true and the same content under data; existing integrations that read data.choices keep working unchanged. Use the top-level fields in new integrations. The request's charge is in the cost.amount field (USD). In non-streaming responses that contain generated images or audio, clients other than the official SDKs receive only the "success": true + data form so that the response size does not double.
Next Steps
You are now ready to use the API. Here are some resources to keep learning: