API keys

The YEScale API uses API keys for authentication. You can create API keys at a user or service account level. Service accounts are tied to a “bot” individual and should be used to provision access for production systems. Each API key can be scoped to one of the following,

Remember that your API key is a secret! Do not share it with others or expose it in any client-side code (browsers, apps).

1

Create an API key

To create an API key, follow these steps:

  • Go to the YEScale website with YEScale AI and log in.
  • If you don’t have an account, you can create one.
  • Click on the “API Keys” button in the left navigation bar.
  • Then, click on the “Add API Keys” button.
  • Enter a name for your API key and click on the “Submit” button.
2

Use your API key

All API requests should include your API key in an Authorization HTTP header as follows:

Authorization: Bearer OPENAI_API_KEY

Example with the YEScale API with OpenAI Python package:

example-python.py
from openai import OpenAI

client = openai.OpenAI(api_key="YOUR_API_KEY", base_url="https://yescale.one/v1")

Example with the openai Node.js package:

example-node.js
import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: "YOUR_API_KEY",
    base_url: "https://yescale.one/v1"
})
3

Tracking your usage

You can track your API usage in the YEScale API dashboard. The dashboard provides information about your API usage, including the number of requests made, the number of tokens used, the price of the requests,…

In YEScale AI, you can create API Token without any restrictions. You can create as many API Tokens as you want. Each API Token can be used for different purposes. For example, you can create an API Token for your development environment and another one for your production environment. You can also create an API Token for each of your team members. This way, you can easily manage your API Tokens and revoke them if needed.