# PromptingTools.jl and OpenRouter

**URL:** https://discourse.julialang.org/t/promptingtools-jl-and-openrouter/137662
**Category:** General Usage
**Tags:** package
**Created:** [June 16, 2026, 9:55pm UTC](https://discourse.julialang.org/t/promptingtools-jl-and-openrouter/137662 "2026-06-16T21:55:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)
#### Post date: [June 16, 2026, 9:55pm UTC](https://discourse.julialang.org/t/promptingtools-jl-and-openrouter/137662/1 "2026-06-16T21:55:04Z")

</div>

I noticed that only selected [OpenRouter](https://openrouter.ai) models are available for PromptingTools.jl. How to use others e.g. the free ones for testing like [openai/gpt-oss-120b:free](https://openrouter.ai/openai/gpt-oss-120b:free)?

---

<div class="post-metadata">

### Author: ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)
#### Post date: [June 17, 2026, 4:21am UTC](https://discourse.julialang.org/t/promptingtools-jl-and-openrouter/137662/2 "2026-06-17T04:21:49Z")

</div>

You should be able to use any openrouter model, since they can use OpenAI chat completions api.

The directions are in Using MistralAI API and other OpenAI-compatible APIs, where you insert your api key and the openrouter url for the model you want to use.

---

<div class="post-metadata">

### Author: ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)
#### Post date: [June 17, 2026, 7:08am UTC](https://discourse.julialang.org/t/promptingtools-jl-and-openrouter/137662/3 "2026-06-17T07:08:41Z")

</div>

Indeed, in fact there is `OpenRouterOpenAISchema()` to make it easier, here’s an example:

```julia-auto
api_key = ENV["OPENROUTER_API_KEY"]
prompt = "Say hi!"
msg = aigenerate(PT.OpenRouterOpenAISchema(), prompt; model="openai/gpt-oss-120b:free", api_key)

```

Thanks @apo383 for the pointer!
