返回 Skill 列表
extension
分类: 开发与工程无需 API Key

openrouter

完整的OpenRouter API文档参考。在使用OpenRouter时请参考——这是一个AI模型路由平台,提供了一个统一的API接口来访问300多个大型语言模型(如OpenAI、Anthropic、Google、Meta、Mistral等)。触发条件:OpenRouter API集成、模型路由、供应商选择、多模型回退、OpenRouter SDK(TypeScript/Python)、OpenRouter聊天完成、OpenRouter嵌入、OpenRouter结构化输出、OpenRouter工具调用、OpenRouter流式传输、BYOK(自带密钥)、OpenRouter OAuth、OpenRouter护栏、通过OpenRouter进行提示缓存、OpenRouter计费/积分、模型变体(:free, :extended, :nitro, :thinking, :online)、广播可观测性集成、零数据保留,或任何涉及openrouter.ai API端点的任务。

person作者: jakexiaohubgithub

OpenRouter Documentation

Complete reference for the OpenRouter API platform. All documentation is stored in references/.

Quick Navigation

Consult references/INDEX.md for the full table of contents with descriptions of every page.

When to Read Which Files

  • Getting started: Read references/quickstart.md
  • API basics (endpoints, auth, params, errors): Read files in references/api/reference/
  • Chat completions: Read references/api/api-reference/chat/send-chat-completion-request.md
  • Streaming: Read references/api/reference/streaming.md
  • Model selection & routing: Read files in references/guides/routing/
  • Model variants (:free, :nitro, etc.): Read files in references/guides/routing/model-variants/
  • Tool calling / function calling: Read references/guides/features/tool-calling.md
  • Structured outputs (JSON schema): Read references/guides/features/structured-outputs.md
  • Embeddings: Read references/api/reference/embeddings.md
  • Authentication & OAuth: Read files in references/guides/overview/auth/
  • SDK usage (TypeScript): Read files in references/sdks/typescript/
  • SDK usage (Python): Read files in references/sdks/python/
  • Framework integrations (Vercel AI, LangChain, etc.): Read files in references/guides/community/
  • Observability (Langfuse, Datadog, etc.): Read files in references/guides/features/broadcast/
  • Multimodal (images, audio, video, PDF): Read files in references/guides/overview/multimodal/
  • Guardrails & spending controls: Read references/guides/features/guardrails.md
  • Pricing & credits: Read references/api/api-reference/credits/
  • Error handling: Read references/api/reference/errors-and-debugging.md
  • Rate limits: Read references/api/reference/limits.md
  • Best practices (latency, caching, uptime): Read files in references/guides/best-practices/
  • Enterprise setup: Read references/enterprise-quickstart.md
  • Responses API (beta): Read files in references/api/reference/responses/

Key Concepts

  • Base URL: https://openrouter.ai/api/v1 (OpenAI-compatible)
  • Auth header: Authorization: Bearer <OPENROUTER_API_KEY>
  • Model format: provider/model-name (e.g. openai/gpt-4o, anthropic/claude-sonnet-4-5)
  • Variants: Append :free, :extended, :nitro, :thinking, :online to model IDs
  • Fallbacks: Pass array of models to models field for automatic fallback
  • Provider routing: Use provider.order, provider.only, provider.ignore for control