APIrove

How do I use APIrove with the OpenAI SDK? (English)

Viewed 7

Is APIrove compatible with the official OpenAI SDKs? What do I need to change?

1 Answers

Yes. APIrove exposes an OpenAI-compatible API, so you only change two things: the base URL and the API key.

from openai import OpenAI
import os

client = OpenAI(
    base_url="https://apirove.com/v1",
    api_key=os.environ["APIROVE_API_KEY"],
)
resp = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
  • Create a key at API Keys. The default text group key covers GPT text models and image generation; create a full group key for Claude models.
  • Use model IDs exactly as listed in the model catalog.
  • Endpoints: /v1/responses, /v1/chat/completions, /v1/images/generations; Claude models use /v1/messages.
  • Pricing: see the pricing page.
  • English docs: apirove.com/en/docs/.