Keep your agent. Change one endpoint.
Keep the first request small: confirm authentication, a non-streamed reply and its request ID. Then test streaming, and add one tool call once the basic path works.
Set the base URL and key.
Keep both in your shell or secret store. Send the key in a header, never in the request body.
Check the key without spending credits.
The account endpoint is never charged. It returns your available credits and the last four characters of the key.
Send a request with your SDK.
Use the OpenAI SDK against /v1 or the Anthropic SDK against the host. Each response carries an X-Request-Id header; save it for support.
Or configure a tested coding agent.
Each agent has a setup page with the exact configuration, a key check and one tool call to verify it. These configurations passed on the Flex build recorded for each one in the compatibility matrix.
# scheme and host from your invitation export FLEX_BASE_URL="https://api.adhibita.com" # from the API keys page of the portal export MUSCLE_FLEX_API_KEY="<FLEX_API_KEY>"
curl -i "$FLEX_BASE_URL/v1/account" \ -H "Authorization: Bearer $MUSCLE_FLEX_API_KEY"
The request, in two SDKs.
import OpenAI from "openai"; const client = new OpenAI({ baseURL: `${process.env.FLEX_BASE_URL}/v1`, apiKey: process.env.MUSCLE_FLEX_API_KEY, }); const res = await client.chat.completions.create({ model: "muscle/auto", messages: [ { role: "user", content: "Summarize this test failure." }, ], });
import Anthropic from "@anthropic-ai/sdk"; // Host only: the SDK adds /v1 itself const client = new Anthropic({ baseURL: process.env.FLEX_BASE_URL, apiKey: process.env.MUSCLE_FLEX_API_KEY, }); const msg = await client.messages.create({ model: "muscle/auto", max_tokens: 1024, messages: [ { role: "user", content: "Summarize this test failure." }, ], });
Two variables
FLEX_BASE_URL- Flex endpoint
MUSCLE_FLEX_API_KEY- Your key
- Model
muscle/auto
Mind the /v1.
OpenAI-shaped clients take the base URL with /v1. The Anthropic SDK and Claude Code take the host alone.
Endpoints
POST /v1/chat/completions- Chat Completions
POST /v1/responses- Responses
POST /v1/messages- Messages
POST /v1/messages/count_tokens- Token count · free
GET /v1/models- Models · free
GET /v1/account- Balance · free
You run the tools.
Flex returns tool calls. Your application executes them and sends the results back.
The examples are illustrative.
The SDK request surfaces are still Pending in the compatibility matrix. The four coding-agent setups have passed on the builds recorded there.
Check compatibility
Tested agents and excluded fields.
What you need.
An accepted invitation.
MUSCLE Flex access and a funded service balance.
A Flex API key.
Created on the API keys page of the portal.
The base URL from your invitation.
The scheme and host only, without a trailing /v1.
Use muscle/auto.
Flex chooses the route for each request, so the model field does not select a model.
Tested coding agents.
Claude Code
Setup page for Claude Code.
Codex CLI
Setup page for Codex CLI.
opencode
Setup page for opencode.
Crush
Setup page for Crush.