Skip to main content

OpenAI-compatible

Keep your OpenAI code, change the base URL

SpicyAPI speaks the OpenAI chat completions format. Point any compatible SDK, framework or chat app at our base URL, use a model ID from the catalog, and stream replies as usual.

What is an OpenAI-compatible API?

It accepts the same requests as OpenAI's chat API. Any tool built for OpenAI can talk to SpicyAPI once you change three settings.

  1. Your app or chat clientOpenAI SDK, LangChain, SillyTavern…
  2. SpicyAPIapi.spicyapi.ai/v1
  3. Chat models26 models behind one key
Your code keeps sending OpenAI-style requests. Only the address, the key and the model name change.

Good for

  • Apps already on the OpenAI SDKSwap the address and key. The rest of your code stays.
  • Roleplay and chat appsSillyTavern, RisuAI and Agnai connect as a custom OpenAI endpoint.
  • Agent frameworksLangChain, Vercel AI SDK and Aider work through their OpenAI adapters.

Connect in three steps

  1. Step 1

    Create an API key

    Log in and create a key in the console. It starts with sk-spicy-.

    header
    Authorization: Bearer sk-spicy-…
  2. Step 2

    Change the base URL

    Replace OpenAI's address with https://api.spicyapi.ai/v1.

    base URL
    https://api.spicyapi.ai/v1
  3. Step 3

    Pick a model ID

    Copy a chat model ID from the list below and send your first message.

    model
    xai/grok-4.7/chat

Three values to change

Most clients add /chat/completions themselves, so enter the base URL only up to /v1. Apps that ask for the full endpoint need https://api.spicyapi.ai/v1/chat/completions.

  • Base URLhttps://api.openai.com/v1https://api.spicyapi.ai/v1
  • API keysk-proj-…sk-spicy-…
  • Modelgpt-4oPick a chat model ID

Setup for your client

Copy the snippet for the SDK, framework or app you already use. Click your tool to jump to its snippet.

curl https://api.spicyapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $SPICY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID_FROM_CATALOG",
    "messages": [{ "role": "user", "content": "Write a two-line opening scene." }],
    "stream": true
  }'

Third-party clients change their config formats between versions. If a snippet here stops matching, the client's own documentation wins.

Chat models you can use

Copy the ID exactly as shown. Prices and context limits are on each model's page.

All chat models (26)

Fix common errors

Most first-time problems are one of these three. Each card shows what you see and the one thing to change.

  • 401

    Unauthorized

    The key is missing, or it is an OpenAI key. Send your SpicyAPI key: Authorization: Bearer sk-spicy-…

  • 404

    Not found

    The base URL is one level off. Use https://api.spicyapi.ai/v1, not the bare domain and not with /chat/completions added twice.

  • model

    Model not found

    OpenAI names such as gpt-4o are not aliases here. Use a full ID in the form maker/model/chat.

Questions people ask