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 openaiStep 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/v1host 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.
该文章对您有帮助吗?