Skip to content
Docs
Request access

Connect OpenAI-compatible providers

The openai-compatible provider talks to services that answer POST {base_url}/chat/completions; it is tested against mock servers for the services listed on this page. Hosted services you reach over https need a key; the key is never typed into a command. The reference page has the full rules. This page is the order of steps.

The operator writes the key to a file outside every repository (mode 0600) and a binding file that names it and the host it may go to. The binding file’s path goes in NURAMESH_OPENAI_COMPATIBLE_KEYS. The values below are obviously fake.

Terminal window
mkdir -p keys
printf 'obviously-fake-test-key-not-a-secret' > keys/groq.key
chmod 600 keys/groq.key
printf '{"keys":{"groq":{"file":"%s/keys/groq.key","hosts":["api.groq.com:443"]}}}' "$PWD" > keys/bindings.json
chmod 600 keys/bindings.json
export NURAMESH_OPENAI_COMPATIBLE_KEYS="$PWD/keys/bindings.json"

The key is bound to host:port. A connection that points the key at another host is refused and nothing is sent. Hosts used by common services: api.openai.com:443, generativelanguage.googleapis.com:443, api.mistral.ai:443, api.groq.com:443, api.together.xyz:443.

--key is the name from the binding file, never the key. A localhost address, a plain http address to a remote host and a key over http are refused.

Terminal window
nuramesh init my-team
nuramesh models connect openai-compatible --team my-team --human human:you \
--endpoint-id groq --endpoint https://api.groq.com/openai/v1 \
--auth key --key groq --yes
nuramesh models connections --team my-team

Output from a real run (the key files above; connect makes no network call). The header row of the table is left out; its columns are provider, endpoint, state, who set it, when and the ledger entry:

connection for openai-compatible/groq created; ledger entry 2
openai-compatible/groq https://api.groq.com/openai/v1 active human:you 2026-11-17T17:05:19Z 2

Base URLs that nuramesh models connect accepted when it was run for the provider pages (with a fake key file and no network call; no live service was called): https://api.openai.com/v1, https://generativelanguage.googleapis.com/v1beta/openai, https://api.mistral.ai/v1, https://api.groq.com/openai/v1, https://api.together.xyz/v1. A Gemini key must come from the binding file: a ?key= in the address is refused.

A model is written openai-compatible/<endpoint id>/<model>, for example openai-compatible/groq/llama-3.3-70b-versatile. It must be in the approved catalog before a price can be set. The CLI creates a catalog entry only for the local-model profile (see Local models); for a hosted service you add the model on the Models page of the app (Catalog tab) or through the API (POST /v1/models/catalog/*). The catalog-entry step for a hosted service was not run from the command line for this page.

Once the entry exists, set a price. --reason is required (3 to 500 characters):

Terminal window
nuramesh models price openai-compatible/groq/llama-3.3-70b-versatile --team my-team --human human:you \
--input-price 0.5 --output-price 1.5 \
--effective-from 2026-11-20T00:00:00Z --source "vendor price list" \
--reason "price from the vendor's list" --yes

Prices are per million tokens in US dollars and are added as new versions, never edited. A missing price blocks the call and records the block. If a service answers without usage numbers, the cost is recorded as unknown. (The same models price command was run for real on a local entry: see Local models.)

Terminal window
nuramesh models test openai-compatible --team my-team --human human:you --endpoint-id groq

This is one metadata request, no prompt and no spend. It needs the network, so it was not run for this hosted example; the same command was run against a local fake server on the Local models page.

Retries: a 429 is retried up to 3 attempts (a Retry-After of up to 30 seconds is honoured); a 503 only when it carries a valid Retry-After; a 500 or another 4xx is not retried.

A model that answers message.content as a list of chunks is refused with “the answer could not be read”, because this version accepts only a plain text answer.

Was this page helpful?