{{define "claim"}} Your llmgw key

Your API key

llmgw · {{.BaseURL}}

{{if .Secret}}

This is shown once. Nothing can produce it again — only its hash was kept.

{{.Secret}}

Store it in a password manager now, then close this page.

Using it

export LLMGW_API_KEY={{.Secret}}

curl {{.BaseURL}}/v1/chat/completions \
  -H "Authorization: Bearer $LLMGW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "<model-name>", "messages": [{"role":"user","content":"hello"}]}'

Replace <model-name> with a name from GET {{.BaseURL}}/v1/models, which needs your key. Sending the placeholder unchanged is answered with the list of models that are available.

from openai import OpenAI
client = OpenAI(base_url="{{.BaseURL}}/v1", api_key=os.environ["LLMGW_API_KEY"])

GET {{.BaseURL}}/v1/models lists what this key may use. GET {{.BaseURL}}/me shows its limits and what it has spent.

{{else if .Gone}}

{{.Message}}

A link works once and then expires. Ask whoever sent it for a new one.

{{else}}

A key was issued for you. Revealing it uses up this link, and the key is shown only this once.

Expires {{.ExpiresAt}}.

{{end}}
{{end}}