Developers
Documentation
A technical guide to integrating leading AI models through Oblion's unified API.
Making Requests
You can paste the following command into your terminal to make your first API request. Be sure to replace YOUR_API_KEY with your secret API key.
curl https://api.oblion.io/v1/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'
This request asks the model to complete the text starting with the prompt "Say this is a test!". You'll receive a response similar to the following:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1677858242,
"model": "claude-sonnet-4-6",
"usage": {
"prompt_tokens": 13,
"completion_tokens": 7,
"total_tokens": 20
},
"choices": [
{
"message": {
"role": "assistant",
"content": "\n\nThis is a test!"
},
"finish_reason": "stop",
"index": 0
}
]
}
You've now generated your first chat completion. Notice the finish_reason of stop, which means the API returned the full completion generated by the model. In the request above, we only generated a single message, but you can set the n parameter to generate multiple messages. Some models are better suited for traditional text-completion tasks, while others are optimized for conversational, chat-based applications.