API Quickstart: Create a Key, Set the Base URL, and Use a Model ID

2026-11-10 · 原创·功能教程

API Quickstart: Create a Key, Set the Base URL, and Use a Model ID

For developers integrating platform models into an application for the first time, the quickstart flow starts with three inputs: an API Key, a Base URL, and a model ID. This tutorial follows the verified steps and uses the development documentation at `/docs` as the entry point. It focuses on preparation, configuration, checking results, and basic safety.

1. Prepare the account and documentation

Sign in to the console and confirm that you can create an API Key. Open the development documentation at `/docs`. The docs list the OpenAI-compatible Base URL and the Anthropic SDK address separately, so note which one matches the SDK you plan to use. Then open the model detail page for the model you want to call and note the model ID shown there. If you plan to use live debugging, sign in and confirm billing first; live debugging requires sign-in and billing confirmation.

2. Create an API Key

Create an API Key in the console. Treat the key as a credential and keep it on the server side, for example in an environment variable or a secret manager. Do not place it in front-end code, public repositories, screenshots, or complete logs. When sharing code or debugging output with teammates, redact the key.

3. Choose the correct Base URL

Choose the Base URL according to the SDK you use. For OpenAI-compatible calls, use the OpenAI-compatible Base URL listed in the docs. For the Anthropic SDK, use the Anthropic SDK address listed in the docs. These are separate addresses; do not swap them. Check the Base URL against the documentation example before sending a request.

4. Set the model value

In the request, set the `model` parameter to the model ID from the model detail page. Use the ID exactly as shown. Do not invent a model name or substitute an ID from a different model. If you change models, return to the corresponding model detail page and confirm the new ID.

5. Send a request and review the result

Use the documentation example to send a request from your server-side code. Read the API Key from a secure server-side source, attach the selected Base URL, and pass the model ID in the `model` field. After the request returns, check the HTTP status code and response body. If the call fails, verify three basics: whether the key is passed correctly, whether the Base URL matches the SDK, and whether the `model` value is the ID from the model detail page. For live debugging, sign in and confirm billing before testing.

6. Safety and operational checks

Keep API Keys server-side and out of public repositories. Avoid logging full request headers that contain the key. Keep OpenAI-compatible and Anthropic SDK Base URLs separate. Confirm the model ID on the model detail page before deployment. For live debugging, complete the required sign-in and billing confirmation steps first.

Next step

After the first request returns, continue with the SDK-specific examples in the development documentation at `/docs`. Use the model detail page to confirm the model ID whenever you change models. This keeps the integration aligned with the documented quickstart and avoids guessing configuration values.