Quickstart
Send your first request to MUSCLE Flex by Adhibita. 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.
You need the Flex base URL from your invitation and a Flex API key from the API keys page of the portal. The examples read both from your shell. The base URL is the scheme and host only; each example adds the path.
bash
export FLEX_BASE_URL="<FLEX_BASE_URL>"
export MUSCLE_FLEX_API_KEY="<FLEX_API_KEY>"The public model id is muscle/auto. Flex chooses the route for each request, so the model field does not select a model.
OpenAI-compatible chat completion
bash
curl -i "$FLEX_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer $MUSCLE_FLEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "muscle/auto",
"messages": [{"role": "user", "content": "ping"}],
"max_tokens": 16
}'Anthropic-compatible message
bash
curl -i "$FLEX_BASE_URL/v1/messages" \
-H "x-api-key: $MUSCLE_FLEX_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "muscle/auto",
"max_tokens": 64,
"messages": [{"role": "user", "content": "ping"}]
}'Authorization: Bearer is also accepted on POST /v1/messages.
Each response carries an X-Request-Id header. Save it: support uses it to find a request.
Coding agents
Each agent has its own setup page with the exact configuration, a key check and one tool call to verify it. Whether an agent wants the host alone or the host plus /v1 differs, and each page says which.
Each of these configurations passed on the Flex build recorded for it. The compatibility matrix records the agent version and Flex build it passed on, and whether it has been re-verified on a later build. Setup pages for other agents are published once their configuration passes.
Moving an existing integration from another router? See the migration guide.
Other clients
These configurations are not yet verified either.
Pi
PI_CODING_AGENT_DIR / ~/.pi/agent/models.json (Pi 0.84+ providers map). Set contextWindow to the context_length that GET $FLEX_BASE_URL/v1/models reports, and maxTokens to the output budget you want per turn:
json
{
"providers": {
"muscle-flex": {
"baseUrl": "<FLEX_BASE_URL>/v1",
"api": "openai-completions",
"apiKey": "$MUSCLE_FLEX_API_KEY",
"compat": {
"supportsDeveloperRole": false,
"supportsReasoningEffort": false
},
"models": [
{
"id": "auto",
"name": "Flex auto",
"reasoning": false,
"contextWindow": <CONTEXT_LENGTH>,
"maxTokens": <MAX_OUTPUT>
}
]
}
}
}Then run pi --provider muscle-flex --model auto. Pi sends the model id auto; Flex routes it the same way as muscle/auto. Do not use --provider openai with the Flex base URL: that provider sends requests to its own default host instead.
Aider
Aider historically strips /v1 from the base URL. Point it at the host only and prefix the model with openai/:
bash
aider --openai-api-base "$FLEX_BASE_URL" \
--openai-api-key "$MUSCLE_FLEX_API_KEY" \
--model openai/muscle/autoStreaming
Set "stream": true on either surface. Responses arrive as server-sent events in the shape your SDK already expects.
Next steps
- Compatibility matrix: what each surface, field and agent does, and what has been verified.
- API Reference: endpoints, authentication, streaming, error codes, rate limits, credits, stop sequences and structured outputs.
- Service status: live status of the Flex gateway.