Skip to main content

Introduction

This guide will walk you through performing your first inference. The steps involve creating an account to get an API key, setting up your local environment, and running the code.

First, choose the platform you will be using. The instructions and code examples on this page will adapt to your selection.

1. Create an Inceptron Account and Obtain Your API Key

  1. Visit the Inceptron website and sign up for a new account.
  2. After signing up, navigate to the account section of the dashboard to create an API key.
  3. Copy the API key and store it securely in an environment variable named INCEPTRON_API_KEY.

To set the environment variable in your terminal:

export INCEPTRON_API_KEY="your_api_key_here"

You can also use an .env file to store your API key securely in your project directory. Create a file named .env in your project's root directory (and make sure to add .env to your .gitignore file to prevent it from being committed). To use the .env file in your project, you can use libraries like python-dotenv for python projects or dotenv for Node.js projects. Read more at Securing Your API Key.

INCEPTRON_API_KEY="your_api_key_here"

2. Set Up Your Development Environment

  1. Ensure you have Python or Node.js installed on your machine.
  2. Install the OpenAI SDK using pip for Python or npm for Node.js:
You can skip the environment setup if you prefer calling the API directly using cURL or another HTTP client.

Python Environment Setup

We recommend that you create a virtual environment to manage your project dependencies. We have found the best way to manage virtual environments is by using uv, which can be installed via pip:

pip install uv

or via a one-liner as found on the uv uv documentation site.

Once uv is installed, create and activate a new virtual environment for your project:

uv venv
source .venv/bin/activate

Then, install the OpenAI SDK:

uv pip install openai

3. Run Your First Inference

The following examples show how to call the Chat Completions API.

Using OpenAI SDK

Stream
import os
from openai import OpenAI

client = OpenAI(
base_url="https://api.inceptron.io/v1",
api_key=os.environ["INCEPTRON_API_KEY"],
)

completion = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct",
messages=[{"role": "user", "content": "How many moons are there in the Solar System?"}],
)

print(completion.choices[0].message.content)

Using cURL

Stream
curl https://api.inceptron.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $INCEPTRON_API_KEY" \
-d '{
"model": "meta-llama/Llama-3.3-70B-Instruct",
"messages": [{"role": "user", "content": "How many moons are there in the Solar System?"}]
}'