Skip to main content
OpenAI-compatible API — any OpenAI SDK client works for the base chat and completion request shape by changing base_url and api_key.
Structured-output helpers from OpenAI’s own API, such as response_format, do not map directly onto Axionic’s /v1/chat/completions route today. For JSON-schema-constrained outputs, use an inline policy via extra_body or the dedicated /sampling/generate endpoint as shown in Using Your Model.

Applying Steering at Inference

Add steering vector fields to any request:
response = client.chat.completions.create(
    model="your-model-name",
    messages=[{"role": "user", "content": "Describe a sunset."}],
    extra_body={
        "steering_vector_id": "sv_abc123",
        "steering_strength": 1.0,
    },
)

Integration Examples

A Python bot that responds to Telegram messages using your trained model.Install dependencies:
pip install python-telegram-bot openai
Bot code:
import os
from telegram import Update
from telegram.ext import Application, MessageHandler, filters, ContextTypes
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AXIONIC_API_KEY"],
    base_url="https://api.axioniclabs.ai/v1",
)

MODEL_NAME = os.environ.get("MODEL_NAME", "your-model-name")

async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE):
    user_message = update.message.text

    response = client.chat.completions.create(
        model=MODEL_NAME,
        messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": user_message},
        ],
        max_tokens=512,
    )

    await update.message.reply_text(response.choices[0].message.content)

def main():
    app = Application.builder().token(os.environ["TELEGRAM_BOT_TOKEN"]).build()
    app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_message))
    app.run_polling()

if __name__ == "__main__":
    main()
Run:
export AXIONIC_API_KEY="ax_your_key_here"
export MODEL_NAME="your-model-name"
export TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
python bot.py

Next Steps