Skip to main content

Use other clients with memtrunk

Any client that sends Anthropic Messages, OpenAI Chat Completions or OpenAI Responses requests can use the memtrunk address and a memtrunk key.

Last updated

A client does not need a special memtrunk plugin. It needs the memtrunk address, a memtrunk key and a supported request format. This page lists the formats, the paths and the key headers.

Supported request formats#

FormatMethod and path
Anthropic MessagesPOST /v1/messages
Anthropic token estimatePOST /v1/messages/count_tokens
OpenAI Chat CompletionsPOST /v1/chat/completions
OpenAI ResponsesPOST /v1/responses
Model listGET /v1/models

The Responses format is also available at POST /responses, POST /v1/responses/compact and POST /responses/compact. The model list is also available at GET /models. Other request formats exist. This page does not describe them.

The token estimate returns {"input_tokens": <number>}. The gateway computes the number from the length of the request text. Treat it as an estimate.

Send the key#

Send the memtrunk key in one of two headers:

HeaderForm
AuthorizationBearer <your-memtrunk-key>
x-api-key<your-memtrunk-key>

The gateway reads the Authorization header first. The Authorization scheme is not case sensitive. A request without a key gets status 401. See authentication headers.

All request formats in the table use the same key check.

Set the base address#

Give the client the memtrunk address without a path. Clients differ in how they join the request path to the base address. Check the base address setting of your client. With a named key, Codex CLI uses <your-memtrunk-address>/v1 as base_url. On a personal address, the proxy token sits between the address and /v1.

Request bodies#

Send the body that the API format defines. The provider that serves the request enforces the rules for the fields. Get a value for model from GET /v1/models. The POST /v1/messages request in the quickstart is a worked example.

Antigravity CLI#

The console shows an Antigravity CLI tab in the setup guide on the Dashboard. The setup guide shows the tool tabs after you connect at least one account of your own. A tab appears for each provider where you can see an account.

The tab leads with your personal address. The address holds your proxy token, so Antigravity CLI needs no API key of its own. If the console shows no personal address, the tab shows steps for a named API key.

Antigravity CLI is agy. The guide says agy needs three things:

  • A model provider setting in its settings file, which switches agy to API-key mode.
  • A base URL variable that holds your personal address.
  • A key variable that holds the text placeholder. memtrunk ignores the value on your personal address.

The guide says agy does not read .env files, so the two variables must come from your environment. It offers a one-session setup, a direnv setup for one project on macOS and Linux, and a permanent setup in your shell profile or, on Windows, your user environment variables.

The tab shows the exact setting names and the settings file path. Copy them from the tab. With a named key, the base URL is the memtrunk address with no path, and the key variable holds the key.

With your personal address, an Antigravity CLI request goes to POST /<your-proxy-token>/v1beta/models/<model>:streamGenerateContent. The gateway also serves the same path with :generateContent.

The setup guide says it tested Antigravity CLI 1.5.12 with agy -p against a local test server. It lists these as not tested: a live provider, other versions, the interactive screen, agy models, the direnv project form, a real zsh login shell, and Windows and PowerShell. The test record also lists GNU sed in the shell-profile edit as not tested. Do not read this page as proof that a live provider works through a personal address.

Next steps#