Call Fungi models with a Team key
Your Team has its own model endpoint. It speaks the same API as OpenAI’s chat completions, so most OpenAI clients and SDKs work once you change two settings: the base URL and the key. Usage is paid from your Team’s balance.
Make a key
Section titled “Make a key”-
In your Team, open Team keys.
-
Under Issue a key, give it a name you will recognize later, like
laptop script, and pick how long it lasts. -
Tick Generate with Fungi models (Team-funded). Leave the other rights off unless this key also needs to use your Computers.
-
Choose Issue key. Copy the key now. It starts with
fungi_and is shown only once.
Treat the key like a password. Anyone who has it can spend your Team’s balance. You can revoke it from the same page at any time.
Find your Team’s address
Section titled “Find your Team’s address”Your Team ID is the part after /teams/ in the address bar when your Team is
open. Your endpoint is:
https://my.fungi.computer/api/teams/<team-id>/v1Try it
Section titled “Try it”Put the key and Team ID in your shell:
export FUNGI_KEY="fungi_..."export FUNGI_TEAM="your-team-id"List the models your Team can use:
curl "https://my.fungi.computer/api/teams/$FUNGI_TEAM/v1/models" \ -H "Authorization: Bearer $FUNGI_KEY"Ask for a reply:
curl "https://my.fungi.computer/api/teams/$FUNGI_TEAM/v1/chat/completions" \ -H "Authorization: Bearer $FUNGI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "@fungi/microdose", "messages": [{ "role": "user", "content": "Name three mushrooms I can grow at home." }] }'The same call with the official OpenAI SDK for JavaScript:
import OpenAI from "openai";
const fungi = new OpenAI({ apiKey: process.env.FUNGI_KEY, baseURL: `https://my.fungi.computer/api/teams/${process.env.FUNGI_TEAM}/v1`,});
const reply = await fungi.chat.completions.create({ model: "@fungi/microdose", messages: [ { role: "user", content: "Name three mushrooms I can grow at home." }, ],});
console.log(reply.choices[0].message.content);And for Python:
import osfrom openai import OpenAI
fungi = OpenAI( api_key=os.environ["FUNGI_KEY"], base_url=f"https://my.fungi.computer/api/teams/{os.environ['FUNGI_TEAM']}/v1",)
reply = fungi.chat.completions.create( model="@fungi/microdose", messages=[{"role": "user", "content": "Name three mushrooms I can grow at home."}],)
print(reply.choices[0].message.content)What works
Section titled “What works”| Endpoints | GET /models and POST /chat/completions |
| Streaming | "stream": true, plus stream_options.include_usage for token counts |
| Tools | tools and tool_choice |
| Settings | temperature, max_tokens or max_completion_tokens, reasoning_effort |
| Models | @fungi/microdose works today. @fungi/trip is listed but not available yet. |
Errors come back in OpenAI’s shape. A missing or wrong key gets 401 with
invalid_api_key. A key without the model right, or for a different Team, gets
403 with permission_denied.