For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Meta
Route agentgateway LLM traffic to the Meta Model API.
Configure Meta as an LLM provider in agentgateway. The meta preset supports the Chat Completions, Messages, and Responses APIs.
Before you begin
Install theagentgateway binary.You need agentgateway 1.6.0 or later and a Meta Model API key. Create a key in the Meta Model API dashboard.
Configuration
Use the meta preset to route requests to the Meta Model API. The preset supplies the provider URL and supported request formats.
Set your API key in the terminal where you will run agentgateway.
export META_API_KEY='<your-api-key>'Create a
config.yamlfile with the following configuration.cat > config.yaml <<'EOF' # yaml-language-server: $schema=https://agentgateway.dev/schema/config llm: models: - name: "*" provider: meta params: apiKey: "$META_API_KEY" # Optional: use this upstream model for every matching request. # model: muse-spark-1.3 # Optional: override the default provider URL. # baseUrl: https://api.meta.ai/v1 EOFSetting Description nameThe model name to match in incoming requests. Use *to accept any model name.providerThe provider preset. Set to meta.params.apiKeyYour Meta Model API key. Use $META_API_KEYto read the key from the environment.params.modelOptional. The upstream model to use for every matching request. Omit to use the model from the request. params.baseUrlOptional. Overrides the provider URL. Defaults to https://api.meta.ai/v1.Validate the configuration.
agentgateway -f config.yaml --validate-onlyExample output:
Configuration is valid!Start agentgateway.
agentgateway -f config.yaml
Example request
From another terminal, send a Chat Completions request to the gateway. This example uses muse-spark-1.3, as shown in the Meta quickstart. Use a model that your Meta account can access.
curl http://localhost:4000/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "muse-spark-1.3",
"messages": [{"role": "user", "content": "Hello from Meta!"}]
}'