Sage Inference API Reference
Complete API reference for all Sage Inference endpoints. Base URL: https://sage-api.devblocktechnologies.com
Live API Playground
Test Sage Inference API endpoints directly from your browser. Enter your API key, customize the request, and see live responses.
Request
Response
Send a request to see the response here
Authentication
All API requests require authentication via Bearer token. Include your API key in the Authorization header of every request.
Authorization: Bearer sk-sage-your-api-key
API keys start with sk-sage- and can be created and managed through the DevBlock Console.
Available Models
| Model ID | Description | Cost |
|---|---|---|
| deepseek-v4-flash | Fast chat | 0.0004 credits/token |
| deepseek-v4-pro | Advanced reasoning/coding | 0.002 credits/token |
| deepseek-reasoner | Deep reasoning | 0.002 credits/token |
| claude-sonnet-4-20250514 | Anthropic's most balanced | 0.006 credits/token |
| claude-haiku-3.5 | Fast Claude | 0.002 credits/token |
| o3-mini | OpenAI reasoning | 0.004 credits/token |
| gpt-4o | OpenAI multimodal flagship | 0.01 credits/token |
| gpt-4o-mini | Lightweight OpenAI | 0.0008 credits/token |
Quality Modes
| Mode | Description |
|---|---|
| auto | Automatically selects quality based on model and task |
| low | Faster response, lower quality (suitable for simple tasks) |
| high | Higher quality, slower response (complex reasoning) |
| ultra | Maximum quality, uses multi-pass refinement |
Endpoints
List all available models and their capabilities.
Response Format
{
"object": "list",
"data": [
{
"id": "deepseek-v4-flash",
"object": "model",
"created": 1700000000,
"owned_by": "devblock"
}
]
}Example Request
curl https://sage-api.devblocktechnologies.com/v1/models \ -H "Authorization: Bearer sk-sage-your-api-key"
Create a chat completion. Supports streaming, vision, and multi-modal inputs.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID to use |
| messages | array | Required | Array of message objects |
| max_tokens | integer | Optional | Maximum tokens (default: 256) |
| temperature | number | Optional | Sampling temperature 0-2 (default: 1.0) |
| stream | boolean | Optional | Enable SSE streaming (default: false) |
Response Format
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "deepseek-v4-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm doing well, thank you!"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 25,
"total_tokens": 35
}
}Example Request
curl https://sage-api.devblocktechnologies.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-sage-your-api-key" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"temperature": 0.7,
"max_tokens": 256
}'Generate images from text descriptions.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID to use |
| prompt | string | Required | Text description of the image |
| n | integer | Optional | Number of images (default: 1) |
| size | string | Optional | Image size (e.g. 1024x1024) |
Response Format
{
"created": 1700000000,
"data": [
{
"url": "https://sage-api.devblocktechnologies.com/v1/images/abc123.png"
}
]
}Example Request
curl https://sage-api.devblocktechnologies.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-sage-your-api-key" \
-d '{
"model": "deepseek-v4-flash",
"prompt": "A serene mountain landscape at sunset",
"n": 1,
"size": "1024x1024"
}'Transcribe audio files to text using speech-to-text models.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID to use |
| file | file | Required | Audio file to transcribe |
| language | string | Optional | Language code (optional) |
Response Format
{
"text": "The transcript of the audio file."
}Example Request
curl https://sage-api.devblocktechnologies.com/v1/audio/transcriptions \ -H "Authorization: Bearer sk-sage-your-api-key" \ -F "model=deepseek-v4-flash" \ -F "file=@audio.mp3"
Generate speech from text using text-to-speech models.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID to use |
| input | string | Required | Text to convert to speech |
| voice | string | Optional | Voice ID (default: alloy) |
Response Format
Binary audio data (MP3 format)
Example Request
curl https://sage-api.devblocktechnologies.com/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-sage-your-api-key" \
-d '{
"model": "deepseek-v4-flash",
"input": "Hello, welcome to DevBlock Sage Inference.",
"voice": "alloy"
}' \
--output speech.mp3SDK Examples (Python)
Sage Inference is fully compatible with the OpenAI Python SDK. Simply point the base URL to our endpoint.
from openai import OpenAI
client = OpenAI(
base_url="https://sage-api.devblocktechnologies.com/v1",
api_key="sk-sage-your-api-key"
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
temperature=0.7,
max_tokens=256
)
print(response.choices[0].message.content)Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid request parameters |
| 401 | Unauthorized - Missing or invalid API key |
| 402 | Payment Required - Insufficient credits |
| 404 | Not Found - Invalid endpoint or model |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server-side issue |
Interactive Examples
Copy these curl commands to test the API directly from your terminal.
List Models
curl https://sage-api.devblocktechnologies.com/v1/models \ -H "Authorization: Bearer sk-sage-your-api-key"
Chat Completion (Streaming)
curl https://sage-api.devblocktechnologies.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-sage-your-api-key" \
-d '{
"model": "deepseek-v4-flash",
"messages": [{"role": "user", "content": "Tell me a joke"}],
"stream": true
}'Chat Completion (Non-Streaming)
curl https://sage-api.devblocktechnologies.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-sage-your-api-key" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{"role": "user", "content": "Write a poem about AI"}
],
"temperature": 0.8,
"max_tokens": 500
}'