AI API setup: Base URL, API Key and model ID
An API connection needs three matching values: the endpoint, an authorized API Key and an exact model ID. Select the protocol first, then send one short request before configuring a larger application.
Choose the protocol before the model
A model family does not determine the endpoint by itself. A Claude model may be offered through native Messages or a converted Chat Completions route; Gemini may use its native API or a compatible route. Conversion can change tool calling, reasoning and multimodal behavior. Run7 supplies the applicable endpoint and model list privately after manual order confirmation.
| Protocol | Typical route | Authentication |
|---|---|---|
| Chat Completions | /v1/chat/completions | Authorization: Bearer … |
| Anthropic Messages | /v1/messages | x-api-key + anthropic-version |
| Other APIs | Follow the delivered reference | Do not infer compatibility |
Base URL is not the complete request URL
Many clients append their own route. If the client expects a Base URL ending in /v1, entering /v1/chat/completions may create a duplicated path. Conversely, a raw HTTP request needs the complete route. Check the client’s convention rather than repeatedly adding or removing /v1.
- Copy the endpoint from your private setup information.
- Enter a model ID exactly, including any version suffix. Display names are not always API IDs.
- Keep keys in an environment variable or the client’s protected settings. Do not publish them in frontend code.
Send one minimal request
For macOS/Linux with cURL. These are placeholders, not a working Run7 endpoint. Set the three values locally; use a short non-sensitive prompt. The example uses max_tokens for compatible routes; some models require max_completion_tokens instead.
export RUN7_BASE_URL="https://YOUR_ENDPOINT/v1"
export RUN7_API_KEY="YOUR_TEST_KEY"
export RUN7_MODEL="YOUR_MODEL_ID"
curl --max-time 60 "$RUN7_BASE_URL/chat/completions" \
-H "Authorization: Bearer $RUN7_API_KEY" \
-H "Content-Type: application/json" \
-d "{"model":"$RUN7_MODEL","messages":[{"role":"user","content":"Reply OK"}],"max_tokens":32}"Move from a successful request to your client
In an OpenAI-compatible client, choose the compatible provider, enter the delivered Base URL and key, then add the exact model ID. First disable optional tools and attachments. Enable them individually after basic text works. A successful text call does not verify image input, tool execution or every feature of an IDE.
Use the API checker for a basic browser test. If it reports a network/CORS issue, run the local request above before concluding that the API is unavailable.
Keep learning
Sources and scope
Based on public protocol references. Delivered model permissions, rates and capabilities govern actual use. This is not a compatibility guarantee for every client version.
Get an API key ↗