OpenRouter Responses [OpenAI Compatible] Large Language Models
openrouter/router/openai/v1/responses
The OpenRouter Responses API with fal, powered by OpenRouter, provides unified access to a wide range of large language models - including GPT, Claude, Gemini, and many others through a single API interface.
Inference
Commercial use
Input
Result
Idle
Waiting for your input...
Waiting for your input...
You will be charged based on the number of input and output tokens.
Logs
π Usage with OpenAI Client (Responses API)
pythonfrom openai import OpenAI import os client = OpenAI( base_url="https://fal.run/openrouter/router/openai/v1", api_key="not-needed", default_headers={ "Authorization": f"Key {os.environ['FAL_KEY']}", }, ) response = client.responses.create( model="google/gemini-2.5-flash", input=[ {"role": "user", "content": "Write a short story (under 200 words) about an AI that learns to dream. Use vivid sensory details and end with a surprising twist that makes the reader feel both awe and melancholy."}, ], temperature=1, ) print(response.output_text)
πΏ Streaming Example (Responses API)
pythonfrom openai import OpenAI import os client = OpenAI( base_url="https://fal.run/openrouter/router/openai/v1", api_key="not-needed", default_headers={ "Authorization": f"Key {os.environ['FAL_KEY']}", }, ) stream = client.responses.create( model="google/gemini-2.5-flash", input=[ {"role": "user", "content": "Write a short story (under 200 words) about an AI that learns to dream. Use vivid sensory details and end with a surprising twist that makes the reader feel both awe and melancholy."}, ], stream=True, ) for event in stream: if event.type == "response.output_text.delta": print(event.delta, end="", flush=True)
π Documentation
For more details, visit the official docs:
- π OpenRouter API Docs β https://openrouter.ai/docs/quickstart
- β‘ fal.ai API Docs β https://docs.fal.ai/model-apis