https://www.boundaryml.com logo
Hi there, we want to use `OpenRouter`
# questions
d
Hi there, we want to use
OpenRouter
for the
openai-provider
generic client. I see that there's
max_completion_token
. I'm a bit confused by the documentation, should we be using
max_completion_tokens
or
max_tokens
? Here's my client setup for `OpenRouter`:
Copy code
client<llm> OpenRouterLlama4Maverick {
  provider openai-generic
  options {
    base_url "https://openrouter.ai/api/v1"
    api_key env.OPENROUTER_API_KEY
    model "meta-llama/llama-4-maverick"
    temperature 0.25
    frequency_penalty 0.5
    max_completion_tokens 8191
    allow_fallbacks false
    provider {
      only ["Groq", "Cerebras"]
      sort "throughput"
      allow_fallbacks false
    }
  }
}
For Groq:
Copy code
client<llm> GroqLlama4Maverick17B {
  provider openai-generic
  options {
    base_url "https://api.groq.com/openai/v1"
    api_key env.GROQ_API_KEY
    model "meta-llama/llama-4-maverick-17b-128e-instruct"
    temperature 0.25
    seed 42
    service_tier "auto"
    max_completion_tokens 8191
    frequency_penalty 0.5
    strategy [
      OpenRouterLlama4Maverick
    ]
  }
}
I ask because
OpenRouter
specifies using
max_tokens
instead [here](https://openrouter.ai/docs/api-reference/completion).
v
You can use max_tokens
In the playground you can actually see the raw curl for a client
So it should make debugging this easier!
d
Gotcha. Yeah sorry I got tripped up reading the docs, appreciate it @Vaibhav (BAML 🐑) 🙌
v
We should fix that! If you’ve got suggestions for verbiage you think would have helped you, feel free to update them 🙂
Appreciate you trying baml