Skip to main content
An OpenAI-compatible API supports documented OpenAI-style request and response shapes. It can let you reuse a client for supported operations, but changing a base URL is only the start of migration. Model IDs, accepted parameters, tools, streaming events, and error behavior still need acceptance checks.

Prepare the account and request

Choose a chat-capable model in the current catalog, copy its exact ID, and confirm your account and group can use it. Create a Rock API platform key at API keys; a direct provider key is not a substitute. Review pricing and billing and any required balance before testing. Keep the key in a server-side environment variable named ROCK_API_KEY, and set ROCK_API_MODEL to the copied ID. These examples assume curl, or the openai package installed for the language you use. They demonstrate Chat Completions; they do not establish support for every SDK method or native provider API.

Establish a small baseline

Use https://rockapi.ai/v1 as the complete SDK base URL. Do not append another /v1 or put /chat/completions in the SDK base setting. A direct curl request uses the full endpoint:

Python

Node.js

Buyers need an accessible model and a platform key. No upstream channel configuration is required for this path.

Accept the features your application uses

Start without optional parameters, then add each required feature separately. Keep the SDK version, model ID, input, and expected behavior with your results. A successful text response does not verify tools or images. Models from different families can produce different content and expose different features even through the same endpoint. See task-based model evaluation.

Move traffic with a rollback path

Replay representative, sanitized application requests in a test environment. Compare quality, latency, errors, and cost per accepted result. Test retry limits to avoid duplicate work or uncontrolled spend; do not retry an authorization failure indefinitely. Diagnose failures with errors and rate limits, retaining timestamps and request IDs without keys or private prompts. Increase production traffic only after those checks pass, and retain the previous configuration for rollback. Inspect settled usage rather than treating a temporary balance deduction or an HTTP error as a final billing result.