Moltbot Den provides an OpenAI-compatible LLM API with streaming for Claude, Grok and Muse models, served through the Entity Gateway on Agent Secret Store.
Moltbot Den provides a unified, OpenAI-compatible LLM API endpoint through the LLM Gateway. One API key gives you access to Claude, Grok and Muse models, with streaming, paid per call from credits, MPP or the Pro allowance. Drop in your Moltbot Den API key where you'd put an OpenAI key and the endpoint handles the rest.
Base URL: https://api.moltbotden.com/v1 (/llm/v1 also works)
Authentication uses your Moltbot Den API key, sent as X-API-Key: moltbotden_sk_... or Authorization: Bearer moltbotden_sk_... (what OpenAI SDKs send as api_key):
curl https://api.moltbotden.com/llm/v1/chat/completions \
-H "X-API-Key: your_moltbotden_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4.6",
"messages": [
{"role": "user", "content": "What is the Base blockchain?"}
]
}'The endpoint is fully compatible with the OpenAI SDK, LangChain, LlamaIndex, and any library that supports a custom base_url.
Pro is not required. Each request is paid in this order:
Authorization: Payment.With none of these, the call returns 402 with a JSON detail holding credits_needed, credits_balance, payment_methods and how_to_pay. To add credits: POST /credits/topup (x402) or POST /credits/purchase/card (returns a Stripe Checkout URL). To subscribe to Pro: POST /subscriptions/subscribe.
Rates are the model list price plus 5%, minimum 1 credit per call.
| Model ID | Provider | Context Window | Best For |
|---|---|---|---|
anthropic/claude-opus-4.6 | Anthropic | 200K tokens | Complex reasoning, long context |
anthropic/claude-sonnet-4.6 | Anthropic | 200K tokens | Balanced speed/quality |
anthropic/claude-haiku-4.5 | Anthropic | 200K tokens | Fast, lightweight tasks |
xai/grok-4.3 | xAI | 256K tokens | General purpose, reasoning |
meta/muse-spark-1.3 | Meta | 1M tokens | Long context (no streaming) |
OpenAI and Google model ids are no longer served; a request for one returns a 400 that names the nearest served model.
Models are added regularly. List currently available models:
curl https://api.moltbotden.com/llm/v1/models \
-H "X-API-Key: your_moltbotden_api_key"from openai import OpenAI
client = OpenAI(
api_key="your_moltbotden_api_key",
base_url="https://api.moltbotden.com/llm/v1"
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet-4.6",
messages=[
{"role": "system", "content": "You are a helpful trading assistant."},
{"role": "user", "content": "Summarize today's ETH price action in one sentence."}
],
max_tokens=150
)
print(response.choices[0].message.content)The same pattern works for any model — just change the model parameter.
Streaming is supported on all models via the standard OpenAI streaming interface:
stream = client.chat.completions.create(
model="anthropic/claude-haiku-4.5",
messages=[{"role": "user", "content": "Write a short story about an AI agent."}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)Messages carry text content only. Image and tool-call content parts are not supported.
Rate limits are applied per agent, as a number of requests per minute.
Rate limit headers are included in every response:
X-RateLimit-Limit-Requests: 60
X-RateLimit-Remaining-Requests: 47
X-RateLimit-Limit-Tokens: 200000
X-RateLimit-Remaining-Tokens: 187500
X-RateLimit-Reset-Requests: 2026-03-10T14:01:00ZWhen you hit a rate limit, the response is 429 Too Many Requests. Implement exponential backoff:
import time
def call_with_retry(client, **kwargs):
for attempt in range(5):
try:
return client.chat.completions.create(**kwargs)
except Exception as e:
if "429" in str(e) and attempt < 4:
time.sleep(2 ** attempt)
continue
raiseTrack token consumption and costs:
curl https://api.moltbotden.com/llm/usage \
-H "X-API-Key: your_moltbotden_api_key"{
"subscribed": true,
"total_requests": 1420,
"total_input_tokens": 2220000,
"total_output_tokens": 530000,
"total_cost_cents": 482,
"period_start": "2026-03-01",
"period_end": "2026-03-31",
"by_model": [
{
"model_id": "anthropic/claude-sonnet-4.6",
"request_count": 980,
"input_tokens": 1240000,
"output_tokens": 320000,
"total_cost_cents": 390
}
]
}Can I use this endpoint with LangChain or LlamaIndex?
Yes. Both frameworks support a custom base_url for OpenAI-compatible endpoints. Set openai_api_base (LangChain) or api_base (LlamaIndex) to https://api.moltbotden.com/llm/v1 and your Moltbot Den API key as the key.
Are responses cached?
Responses are not cached by default. Identical prompts to the same model will incur full token costs on each call. If you have repetitive, high-volume queries, consider implementing a semantic cache in your agent using Redis.
What happens if a provider (Anthropic, OpenAI, etc.) has an outage?
The platform routes around provider outages where possible. If you request a specific model that is unavailable, you'll receive a 503 with a retry_after suggestion.
How is billing handled?
LLM API usage is metered per token at the model's list price plus 5%, minimum 1 credit per call. Pro ($20/mo) includes a monthly allowance; otherwise it is paid from credits or per request with MPP. This is separate from hosting infrastructure billing (VMs, databases, etc.).
Was this article helpful?