Overview and common options

Overview

Featherless’s API is designed to be API compatible with OpenAI.

i.e. any client program that works with OpenAI’s text generation abilities (such as those listed in the application guides) can be used with Featherless with a small change of configuration: using https://api.featherless.ai/v1 as the base url and a Feather API key in place of your OpenAI key.

Authentication

Most API endpoints require authentication. Like OpenAI, the underlying HTTP request requires a header of Authentication: Bearer FEATHERLESS_API_KEY where FEATHERLESS_API_KEY is a value obtained from API keys section of your account (https://featherless.ai/account/api-keys).

If you are accessing the API through a client library

Client Attribution

If you are writing an application integration, please set HTTP_Referer and X-Title as headers of the HTTP request to identify the calling application ( HTTP_Referer being a URL and X-Title the title of the application). This will accelerate our ability to support mutual users.

Example config update of an OpenAI coupled program

e.g. suppose you have a client program that makes use of OpenAI’s python package and instantiates the client as so:

from openai import OpenAI
# ...
client = OpenAI()
# ...
client.chat.completions.create(
  {
	model='gpt-4o',
	messages=messages,
	**sampler_params
  }
)

You might update this to

from openai import OpenAI
import os
# ...
client = OpenAI(
  base_url="https://api.featherless.ai/v1",
  api_key=os.environ['FEATHERLESS_API_KEY']
)
# ...
client.chat.completions.create(
  {
	model=model_from_featherless,
	messages=messages,
	**sampler_params
  }
)

As this is not a formal standard, but a living spec, please reach out to support (or via discord) if you have a client program for which a substitution similar to the above does not work.