Run7 AIGet an API key ↗
RUN7 / LEARN & BUILD

AI API setup: Base URL, API Key and model ID

By Run7 AI · Updated: 2026-11-17

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.

ProtocolTypical routeAuthentication
Chat Completions/v1/chat/completionsAuthorization: Bearer …
Anthropic Messages/v1/messagesx-api-key + anthropic-version
Other APIsFollow the delivered referenceDo 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.

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

All guides · API checker

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.