Skip to content

Provider ​

Overview
What it isA model API endpoint (OpenAI-compatible, Anthropic or Gemini) and the API key to reach it
CLIagt provider
Agent toolsresource_* with kind: "provider", provider_models, resource_test
Web consoleResources → Provider
Fileproviders/<category>/<name>/provider.yaml
Crateagt-provider

What it does ​

A provider tells agt where to send model requests. It works with OpenAI, Anthropic, Google Gemini, API gateways, and local servers such as Ollama or vLLM that implement the OpenAI API. Models refer to a provider, and each chooses the API format that provider speaks; one provider can serve many models.

How to use it ​

Web console: Resources → New resource → Provider. Enter a name, the base URL and the API key.

CLI:

bash
agt provider create openai --base-url https://api.openai.com/v1 --api-key-env OPENAI_API_KEY
agt provider list-models openai
agt provider update openai --base-url https://gateway.example.com/v1

Agent tools:

json
{"kind":"provider","reference":"main","create":true,
 "data":{"base_url":"https://api.openai.com/v1","api_key":"sk-..."}}

Common parameters ​

ParameterMeaning
--base-urlThe API root, usually ending in /v1
--api-key-env <VAR>Read the key from an environment variable when the command runs
--api-key-stdinRead the key from standard input, keeping it out of shell history

All parameters ​

agt provider create <name> ​

OptionRequiredDefaultMeaning
--base-url <url>yesAPI root URL
--api-key <key>one of threeThe key itself (visible in shell history and process lists)
--api-key-stdinone of threeRead the key from standard input
--api-key-env <VAR>one of threeRead the key from this environment variable
--type <type>noopenai-compatibleProvider type; currently only openai-compatible
--category <c>nodefaultCategory

The key is read once, when the command runs, and stored in provider.yaml. Changing the environment variable later does not change the stored key.

agt provider update <name> ​

OptionMeaning
--base-url <url>New base URL
--api-key <key>, --api-key-stdin, --api-key-env <VAR>New key (at most one)
--category <c>Category of the provider to update

Other commands ​

CommandMeaning
test <ref>Validate the stored configuration. Does not contact the server.
list-models <ref>Call the provider's /models endpoint with the stored key. Does not run inference. Tries OpenAI-compatible, then Anthropic, then Gemini credentials.
list, info, delete, categorySee Resources

File: provider.yaml ​

yaml
name: openai
type: openai-compatible
base_url: https://api.openai.com/v1
api_key: sk-...
FieldMeaning
nameSame as the directory name
typeopenai-compatible
base_urlAPI root URL
api_keyThe stored key, in plain text

Tool fields (resource_write, kind: "provider") ​

FieldOn createMeaning
base_urlrequiredAPI root URL
api_keyone of twoThe key
api_key_envone of twoName of an environment variable of the agt process; its current value is stored

On update, any field may be given. Keys are never returned by any tool, list or error.

ToolParametersMeaning
provider_modelsreferenceList the provider's models with the stored key
resource_testkind: "provider", referenceValidate the configuration only
  • Model: the models that use this provider
  • Resources: categories, deletion, shared tools

Released under the MIT License.