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
- Sign in to the Console and open the API key management page.
- Click create and fill in a name and other details as needed.
- 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-..."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:
https://api.gate.fim.aihttps://api.gate.fim.ai/v1https://api.gate.fim.ai/v1/chat/completions
After configuring, send a test message — if you get a reply, the setup is working.
Chat APIs
Compatibility scope of the chat/completions and responses APIs, plus the extended parameters available when calling Responses-only models through the chat API.
Special Usage
Extensions beyond the standard OpenAI format, including model-name suffix shortcuts, Gemini web search, and code execution.