Prerequisites

更新时间:
复制 MD 格式

AI Search Open Platform is compatible with OpenAI APIs. To call its services, configure the OpenAI SDK with your endpoint and API key. Complete the following three steps before making your first API call.

Step 1: Install the OpenAI SDK for Python

# Installs the latest version of the OpenAI SDK.
# If this command fails, replace pip with pip3.
pip install -U openai

Step 2: Get your endpoint

The base_url indicates the network access address of the service, through which you can access the features or data provided by the service. The base_url for AI Search Open Platform follows this format:

https://{host}/compatible-mode/v1

host is the service endpoint address for your AI Search Open Platform instance. To find the correct value, see Query endpoints.

Step 3: Get an API key

AI Search Open Platform uses API keys for authentication. To create or retrieve your API key, see Obtain an API key.