Getting Started

Introduction

Getting started

To begin with Aipify, you must first create a free account. After logging in, navigate to the profile page to retrieve your token.

This token is necessary for authenticating your API calls. It's crucial to keep your API key confidential and not to expose it in the browser or any client-side code to ensure the security of your account.

Make sure to pass the token as authorisation header to all your request as following

Terminal
    curl --request POST \
      --url https://api.aipify.co/{api_name} \
      --header 'Authorization: Bearer daa015e25ee5b85xxxxxxxxxxxx' \
      --header 'Content-Type: application/json' \
      --data '{
        "messages" : [
          { "role": "user", "content": "Write a dad joke" }
        ]
      }'

Define your API endpoint

Click on the New Endpoint button and provide a name and description for your endpoint

  • Name : Choose a unique name for your endpoint. This name will be used as a path parameter in the API URL (e.g., https://api.aipify.co/{name}).
  • Description : Provide a clear and concise description of the endpoint's functionality. This description will be used to guide the LLM model during request processing.
  • Model selection: Currently, Aipify supports OpenAI models. Select the desired model from the available options.
By default the newly created endpoint will be in sandbox mode. You can change the status to live . the sandbox mode is powered by openai-api-mock this will serve the responce from the mock server. You can also use the sandbox mode to test your endpoint before making it live. so that you can test your endpoint without consuming your output tokens.

Define your response structure

Click on the dropdown menu for your newly created endpoint and select "Edit."

Define the expected structure of the API response using a JSON schema. This outlines the data format and properties that will be returned by the API.

To create a field click on New field button and provide a name and description type of field

  • Name : Choose a unique name for your field.
  • Description : Provide a clear and concise description of the field's functionality.
  • Type : Select the type of the field from the available options (e.g., string, number, array, etc.)

Copyright © 2024