Skip to main content

Quick Start

Get started with Nebul's Private inference-api in minutes. The Private inference-api provides instant access to the latest language and other AI models, including Mistral Large 3, OpenAI's GPT-OSS, DeepSeek R1, Qwen3, and more, all through a single OpenAI-compatible interface. Deploy AI capabilities without the complexity of managing infrastructure, while maintaining full privacy and security for your data.

Prerequisites

Before you begin, you'll need:

  • A Nebul AI Studio with API access
  • An API key (get one from your Nebul AI Studio)
  • If using Python, you need to use Python version 3.9 or higher

Installation

bash
1
pip install openai

The Nebul inference-api is fully compatible with the OpenAI SDK, so you can use the same library you're already familiar with.

Available Endpoints

EndpointMethodDescription
/v1/chat/completionsPOSTChat-based completions (recommended)
/v1/completionsPOSTLegacy text completions
/v1/responsesPOSTAdvanced responses with async support
/v1/embeddingsPOSTGenerate vector embeddings
/v1/rerankPOSTRerank documents by relevance
/v1/modelsGETList available models
/v1/audio/transcriptionsPOSTSpeech to text
/v1/audio/speechPOSTText to speech
/v1/ocrPOSTOptical character recognition
/v1/images/generationsPOSTImage generation
/v1/images/editsPOSTImage editing
/v1/images/variationsPOSTImage variations

List Available Models

Discover which models are available to your account:

python
12345678910
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key-here",
base_url="https://api.inference.nebul.io/v1"
)
models = client.models.list()
for model in models.data:
print(model.id)

Your First LLM Request

Here's a simple example to get you started:

python
12345678910111213141516
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key-here",
base_url="https://api.inference.nebul.io/v1"
)
# Replace openai/gpt-oss-120b with the model you want to use returned by the models endpoint
response = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[
{"role": "user", "content": "Why is privacy important in the age of AI?"}
]
)
print(response.choices[0].message.content)

Replace sk-your-api-key-here with your actual API key from Nebul AI Studio.

tip

API keys always start with sk- ("secret key-"). Store them securely in environment variables rather than hardcoding.

Error Handling

API errors follow a standard format:

json
12345678
{
"error": {
"message": "Invalid API key provided",
"type": "auth_error",
"param": null,
"code": "401"
}
}

Common error codes:

CodeMeaning
401Invalid or missing API key
403Model not available for your account
429Rate limit exceeded (see limits)
500Server error — retry the request

What's Next?

Now that you've made your first request, explore more capabilities:

  • Examples - See more code examples and use cases
  • Models - Browse available models and their capabilities
  • API Reference - Explore the complete API documentation