Getting Started

Usage

Detailed guide on the request parameters for customizing API calls to Aipify.

Request Parameters

This section provides a comprehensive explanation of the request parameters that can be utilized to tailor your API calls to Aipify.

Required Parameters:

  • api (string): Represents the name of the API endpoint you wish to interact with. This name is defined during the creation of the endpoint.
    • Example: https://api.aipify.co/your-endpoint-name.
  • messages (array of objects): An array of objects that symbolize the conversation history or prompts for the LLM. Each object should contain:
    • role (string): Can be either "system" or "user", indicating the sender of the message.
    • content (string): The actual content of the message.

Optional Parameters (Body):

  • mode (string): Determines the mode of the request. Valid values include:
    • prompt: This mode uses Prompt engineering techniques and defines a default system message for your request.
    • tools: This mode uses OpenAI Function calling to structure the response (default).
  • raw (boolean): If set to true, the response from OpenAI is returned without any further processing.
  • cache (boolean): If set to true, the system attempts to save the responce in the cache for future use. This can help reduce the number of tokens consumed by your API calls.
The system is set to retain cache for a default duration of 3600 seconds (equivalent to 1 hour). If caching is activated, and a valid, unexpired cached response is available, the system will return this response. You have the option to modify the cache retention period by adjusting the cache_age parameter in the request body.

Additional Parameters (Headers):

  • Authorization (Bearer token): A valid authorization token is necessary to authenticate requests.
  • Content-Type (string): The type of content in the request body. The default value is application/json.

Copyright © 2024