All Products
Search
Document Center

OpenSearch:Before you begin

Last Updated:Aug 05, 2025

AI Search Open Platform is compatible with OpenAI APIs. Developers can use OpenAI SDKs to call the services provided by AI Search Open Platform. The developers only need to configure the authentication information and addresses for calling the services.

  • Download and install the OpenAI SDK for Python

    # If an error message is returned after you run the following command, replace pip with pip3. 
    # This command is used to install the latest version of OpenAI SDK.
    pip install -U openai
  • Obtain the service call address base_url

    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 format is as follows:

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

    host specifies the service call address of AI Search Open Platform. For more information, see Query endpoints.

  • Obtain identity authentication information

    When you use an OpenAI SDK to call an AI Search Open Platform service, your identity must be authenticated based on an API key. For information about how to obtain the authentication information, see Obtain an API key.