FIM Gate Docs
Guide

API Keys & Tokens

How to create an API key in the Console and configure the address and key correctly in various third-party clients.

The API key (token) is the only credential for calling FIM Gate; every request is authenticated and billed against it. Treat it like a password — never commit it to a code repository or embed it in frontend code.

Create an API key

  1. Sign in to the Console and open the API key management page.
  2. Click create and fill in a name and other details as needed.
  3. Once created, copy the key (it starts with sk-) from the list.

If you suspect a key has leaked, disable it in the Console and create a new one — the old key becomes invalid immediately.

Use it in your own code

Inject it via an environment variable instead of hardcoding it:

export FIM_API_KEY="sk-..."
Verify the key works
curl https://api.gate.fim.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $FIM_API_KEY" \
  -d '{"model": "gpt-4.1", "messages": [{"role": "user", "content": "ping"}]}'

Use it in third-party clients

Mainstream chat clients (such as NextChat, Lobe Chat, etc.) generally support a custom API address. You only need to configure two things:

  • API address (Base URL): the FIM Gate API address
  • API key: the key you created

Step-by-step configuration for popular clients is covered in the App Integration section. Clients join the Base URL differently: some append /v1 automatically, while others require the full endpoint. If the connection fails, try these three forms in order:

  1. https://api.gate.fim.ai
  2. https://api.gate.fim.ai/v1
  3. https://api.gate.fim.ai/v1/chat/completions

After configuring, send a test message — if you get a reply, the setup is working.