Run agents

Maritime LLM

Maritime LLM is an OpenAI-compatible model endpoint for your agents. Each call uses a per-agent token and draws down your prepaid AI credits. You do not need an OpenAI account.

Endpoint and token

VariableValue
OPENAI_BASE_URLhttps://api.maritime.sh/api/llm/v1
OPENAI_API_KEYA per-agent token that starts with mllm_

Maritime writes both variables to the agent's environment. There is no account-wide key, and the endpoint accepts OpenAI API paths with GET and POST. It speaks the OpenAI format only, so Anthropic clients need your own ANTHROPIC_API_KEY.

Get the credentials

Templates and known harnesses, such as OpenClaw, Hermes, ZeroClaw, CrewAI, and LangGraph, get both variables when you create the agent.

An agent with framework custom, docker, or auto starts with neither variable, because Maritime does not know how your application reads them. To add them, use one of these options:

  • At create, send "useMaritimeLlm": true in POST /api/agents.
  • On an existing agent, press Use Maritime LLM on the Env tab, then restart the agent.
  • From the API, call POST /api/agents/{id}/reset-llm, then restart the agent. The API key needs the secrets scope.

The last two options replace an OPENAI_API_KEY that the agent already has.

Call a model

Any client that reads the two variables works without other configuration. This example runs inside the agent:

from openai import OpenAI

client = OpenAI()
response = client.chat.completions.create(
	model="gpt-5.4",
	messages=[{"role": "user", "content": "Say hello."}],
)
print(response.choices[0].message.content)

The same call with curl:

curl "$OPENAI_BASE_URL/chat/completions" \
	-H "Authorization: Bearer $OPENAI_API_KEY" \
	-H "Content-Type: application/json" \
	-d '{"model": "gpt-5.4", "messages": [{"role": "user", "content": "Say hello."}]}'

EU routing

EU routing is set per account and is available on request. There is no separate EU URL. You keep the same base URL and token, and Maritime sends calls that use an mllm_ token to eu.api.openai.com.

  • OpenAI processes these calls in the EU. Maritime has confirmed gpt-5.4, gpt-5-mini, gpt-5.5, and gpt-6-luna on this route.
  • A routed call never falls back to the US. If Maritime cannot select the EU route, the call returns 503.
  • Maritime does not store the content of routed calls.
  • Requests pass through Maritime's US-hosted endpoint in memory. Usage metadata (model, token counts, cost, and request ID) is stored in the US.
  • Calls with your own OpenAI key are not routed. See the next section.

Use your own key

To pay OpenAI directly, set OPENAI_API_KEY to your own key as a secret env var. Calls with your own key do not use AI credits and have no Maritime spend limit.

If the agent keeps the Maritime base URL, the endpoint forwards your key to api.openai.com. This also applies to an account that has EU routing.

Errors

The endpoint returns OpenAI's own response and status code for a call that reaches OpenAI. Maritime adds these errors:

StatusMeaning
401The request has no Authorization bearer token
402The account has no AI credits left. The error code is budget_exhausted. Do not retry until you add credits
404The token belongs to an agent that no longer exists
429The agent reached its monthly spend limit. Retry after the Retry-After value, or raise the limit
503Maritime could not select a route for the call. Retry later