blog.iankulin.com

Openrouter

Using LLMs programmatically

A minimal JavaScript demo of calling an LLM from your own code using the OpenAI-compatible chat completions endpoint via OpenRouter, covering API keys, model selection, and request structure. It walks through the JSON response, pointing out finish reasons, reasoning tokens, cost fields, and provider routing...