Is APIrove compatible with the official OpenAI SDKs? What do I need to change?
Is APIrove compatible with the official OpenAI SDKs? What do I need to change?
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)
/v1/responses, /v1/chat/completions, /v1/images/generations; Claude models use /v1/messages.