Skip to content

OpenAI API Integration

Welcome to basebox's OpenAI-compatible API! This powerful feature allows you to use any tool, library, or application designed for OpenAI's API with your self-hosted basebox instance.

The OpenAI-compatible API is always available — it no longer needs to be switched on and is part of every basebox installation.

🚀 Quick Start

New to the OpenAI API? Start here:

  1. Release Overview - Learn what's new in basebox 1.7.0 and why this matters
  2. User Guide - Complete technical documentation with examples
  3. IDE Integration - Connect your favorite code editor to basebox
  4. OpenClaw Integration - Use basebox with OpenClaw for AI coding workflows

🎯 What Can You Do?

With the OpenAI-compatible API, you can:

  • Use any OpenAI-compatible tool with your self-hosted models
  • Integrate AI into your development workflow (VS Code, Zed, Neovim, etc.)
  • Build custom applications using familiar OpenAI libraries
  • Test and prototype with interactive Swagger UI
  • Maintain privacy and control while using popular AI tools
  • Use thinking modes through the API — see Thinking Modes

📖 Documentation Overview

For Beginners

For Developers

For Tool Integration

🔧 Quick Examples

Test Your Connection

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     https://your-basebox.example.com/v1/models

Simple Chat Request

curl -X POST "https://your-basebox.example.com/v1/chat/completions" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_TOKEN" \
     -d '{
       "model": "claude-sonnet-4",
       "messages": [
         {"role": "user", "content": "Hello, what model are you?"}
       ]
     }'

Interactive Testing

Visit https://your-basebox.example.com/v1/api/docs for Swagger UI testing interface.

🆘 Need Help?

Clearer error messages

Error responses have been improved to be more precise:

  • An invalid API key returns a precise authentication error.
  • An unknown model, a timeout, or an oversized request each return a clear, specific message.
  • No artificial instructions are added for Anthropic models.
  • Code Assistance: Use GitHub Copilot, Cursor, or similar tools with your models
  • Custom Applications: Build chatbots, content generators, or analysis tools
  • Development Workflow: Integrate AI directly into your editor
  • Team Tools: Create organization-specific AI-powered utilities

Ready to get started? Jump to the User Guide or try the interactive Swagger UI at /v1/api/docs on your basebox instance.