Skip to main content
A relay needs two things to start working: the API’s base URL and the credential Bifrost signs in with. Everything else (routes, pricing, headers, timeouts) can be added or changed later. The name cannot. The examples on this page use a relay called web-search that points at https://api.example.com. Replace them with your API’s name, URL and secret.

Create the relay

  1. Open Relays in the sidebar and select Add Relay.
  2. Enter a Name. Callers will use /relay/<name>/....
  3. Enter the Base URL of the API.
  4. Pick how Bifrost signs in under Authentication, and enter the API Key.
  5. Select Add Relay.
The Add relay sheet with a name, base URL and authentication method
The new relay appears in the list on the left, with no routes yet. Select Edit Relay Config to change any of the settings below. The settings are split across five tabs: General, Authentication, Advanced, Network and Proxy. Each tab has its own save button.To create and manage relays over the API, see the API reference.

Name and base URL


Authentication

Callers never see or send the API’s secret. They send their Bifrost virtual key, and Bifrost adds the relay’s credential to each call before it goes out. Any credential header the caller sends (Authorization, x-api-key, api-key, cookies and similar) is removed first. Pick the method the API expects under Authentication, either when you add the relay or on the Authentication tab of Edit Relay Config.
The most common method. Enter the key under API Key, and Bifrost sends it as Authorization: Bearer <key>.
The Authentication tab with Bearer token selected
The same relay in config.json:
In Helm, every example above goes under bifrost.relays with the same fields.

Extra headers

Extra Headers on the Advanced tab are added to every call the relay sends. Use them for headers the API always needs, such as an account ID, an API version or a second key.
The Advanced tab with the Extra Headers table highlighted
In config.json, this adds a team name and a second account key (read from an environment variable) to every call:
  • If a caller sends a header with the same name, the caller’s copy is removed and yours is used.
  • Each header name may appear once. X-Team and x-team together are refused.
  • Values of headers that carry credentials are masked in the dashboard and API.

Network

The Network tab controls the connection from Bifrost to the API.
The Network tab with timeouts, connection limit and TLS settings
In config.json, this gives a slow API 30 seconds per call, lets its streams stay quiet for 2 minutes, and caps it at 1,000 open connections:
A normal (not streamed) reply can be up to 64 MB. For larger replies, make the route stream.

Proxy

The Proxy tab sends this relay’s traffic through a forward proxy.
The Proxy tab with an HTTP proxy configured
Username, Password and CA Certificate (PEM) are optional. The CA certificate is for proxies that inspect TLS traffic. In config.json, this sends the relay’s traffic through an HTTP proxy inside your network:
When the global proxy changes, every relay that inherits it picks up the change.

All fields


Next steps