OpenRouter、1 つの API で全モダリティを処理
OpenRouter は、テキスト、画像、動画、音声、埋め込みベクトルなどすべてのモダリティを単一の OpenAI 互換 API エンドポイントで統合し、開発者が複数のプロバイダー SDK を管理する手間を劇的に削減するプラットフォームを発表した。
キーポイント
統一された API インターフェースの実現
OpenRouter は単一のベース URL(https://openrouter.ai/api/v1)と API キーで、チャット、画像生成、動画生成、音声処理、埋め込みベクトルなど 5 つ以上の異なるモダリティを扱えるようにした。
開発工数の劇的な削減
従来のアプローチでは各プロバイダーの SDK、認証、課金システムを個別に実装する必要があったが、この新機能により 1 つの設定で全てのモダリティに対応可能となり、統合と保守のコストが大幅に低下する。
柔軟なルーティング制御の適用
チャット呼び出しと同じく、埋め込みや画像生成などのリクエストに対しても、フェイルオーバー、データ収集ポリシー(deny)、コスト/レイテンシ順のソートといった高度なルーティング制御を適用できる。
課金と制限の明確化
プロバイダー価格へのマージン付加はなく、失敗したリクエストは課金されないが、埋め込みの非ストリーミング対応や音声入力の base64 形式要件など、実装上注意すべき技術的制約も提示されている。
統一されたAPIエンドポイントとルーティング機能
テキスト、画像、動画などすべてのモダリティが単一のAPIキーと一貫したリクエスト形式で利用可能であり、チャット呼び出しと同じプロバイダー設定オブジェクト(順序、フォールオーバー、コストソート)を埋め込みや画像生成にも適用できます。
タスクごとの適切なエンドポイントの使い分け
画像生成と理解、動画生成と分析、音声出力と入力など、同じメディアタイプ内でも「生成」と「理解」は異なるエンドポイント(例:/images, /videos, /chat/completions)を使用し、それぞれに固有のパラメータや非同期処理の仕組みがあります。
コストと管理面の統合による効率化
単一の請求書で全モダリティの使用状況を把握でき、プロバイダーごとの別キー管理が不要になるほか、失敗したリクエストには無料の「Completion Insurance」が適用され、失敗時のフォールオーバーも無料です。
重要な引用
You're building an app that needs to answer questions in chat, generate product images, search a knowledge base, and turn voice memos into text. The default path is 4 provider SDKs, 4 billing relationships, and 4 auth schemes to wire up before you write a line of feature code.
On OpenRouter, every one of those modalities runs through a single OpenAI-compatible base URL: https://openrouter.ai/api/v1.
The same routing controls that protect a chat call protect an embeddings call.
One API key, one bill, one request format across every modality.
Zero Completion Insurance means a failed run isn't billed, so a request that fails over and never completes costs nothing.
"Image generation uses the dedicated /images endpoint, embeddings use /embeddings, and transcription uses /audio/transcriptions. You change the endpoint and content type, not the integration, the auth, or the API key."
影響分析・編集コメントを表示
影響分析
この発表は、マルチモーダル AI アプリケーション開発におけるインフラの複雑さを解消する重要な転換点となる。開発者が個別のプロバイダーごとの差異や認証管理に費やす時間を削減し、プロダクト機能の実装とイノベーションにリソースを集中させる環境を提供することで、AI アプリ開発のスピードとアクセシビリティが大幅に向上すると予想される。
編集コメント
OpenRouter のこのアプローチは、マルチモーダル AI アプリ開発における「インフラの断片化」という長年の課題に対する実用的な解決策と言えます。複数のプロバイダーをまたぐ複雑さを抽象化することで、開発者がビジネスロジックに集中できる環境を整える点は、業界全体の生産性向上に寄与する重要な一歩です。
チャットでの質問応答、製品画像の生成、ナレッジベースの検索、音声メモの文字起こしなど、多様な機能を備えたアプリを開発しようとしている場合、通常は 4 つのプロバイダー SDK、4 つの課金契約、そして 4 つの認証方式をすべて実装してから、ようやく機能コードを書き始めることになります。r/Bard のある開発者は LLM、画像、動画生成モデル向けの統一 API を探しており、r/ShowYourApp の別の開発者は自らそれを実装した結果、テキスト、画像、動画、音声合成 (TTS)、音声認識 (STT)、埋め込みベクトルなどすべてのモダリティを共存させるのは「予想以上に難しかった」と報告しています。
OpenRouter では、これらすべてのモダリティが単一の OpenAI 互換ベース URL(https://openrouter.ai/api/v1)を経由して動作します。この URL は一度設定するだけでよく、後はモデル名とコンテンツタイプを変更するだけです。カタログには 70 社以上のプロバイダーから選べる 400 種以上のモデル が揃っており、チャット呼び出しを保護するためのルーティング制御は、埋め込みベクトルの呼び出しにもそのまま適用されます。
Tl;dr
- 単一のベース URL(https://openrouter.ai/api/v1)を設定し、画像、動画、音声、埋め込みベクトル、文字起こしをすべてそこから呼び出します。モダリティの切り替えは、モデル名とコンテンツタイプを変更するだけで可能です。
- 入力モダリティの多くは /chat/completions エンドポイントを利用しますが、5 つの機能には専用のエンドポイントが用意されています:/images、/videos、/audio/speech、/audio/transcriptions、および/embeddings。
同じプロバイダールーティングオブジェクト(フェイルオーバー、データ収集:拒否、コスト/レイテンシー順)は、チャット呼び出しの場合と同じように埋め込み呼び出しでも機能します。
1 つの API キー、1 つの請求書、5 つのモダリティ全体で統一された OpenAI 形式のリクエスト。プロバイダー料金のマークアップは行わず、失敗したリクエストも請求されません。
計画に反映すべき実際の制限事項として、埋め込みはストリーミングに対応していないこと、音声入力は base64 形式のみであること、動画 URL サポートがプロバイダー固有であることが挙げられます。
1 つの API で画像、動画、音声、埋め込み、文字起こしをすべて扱えるのか?
可能です。1 つのベース URL がすべてのモダリティに対応しており、モデル文字列とリクエストコンテンツタイプを変更するだけで切り替えられます。https://openrouter.ai/api/v1 をベース URL に設定し、API キーを Bearer トークンとして渡すことで、OpenAI 互換インターフェースを通じてカタログ全体にアクセスできます。
4 つのプロバイダー SDK を接続する場合、各プロバイダーは独自のリフレッシュ認証、リトライとバックオフのセマンティクス、レート制限ヘッダー、ストリーミング形式、エラースキーマを持ち込みます。その調整コードを 4 回記述し、4 回維持管理する必要があり、あるプロバイダーの変更が他プロバイダーに影響することは決してありません。
私たちは OpenAI Chat API のドロップイン代替品として機能しています。そのため、/chat/completions エンドポイントを利用するすべてのモダリティでリクエスト形式は共通です。また、TTS(テキスト読み上げ)エンドポイントは OpenAI Audio API に準拠しています。
画像生成、動画生成、文字起こし、埋め込みベクトルといった専用エンドポイントはそれぞれ独自のリクエスト形状を持っていますが、公式 SDK(TypeScript 用 @openrouter/sdk、Python 用 openrouter)がこれらすべてを単一のインターフェースとしてラップしています。
各モダリティはどのエンドポイントを使用するか?
ほとんどの入力モダリティは /chat/completions を利用し、コンテンツタイプによって区別されます。一方、5 つのモダリティには専用エンドポイントが用意されています。以下に、マルチモーダル概要 と 埋め込みリファレンス に基づいた完全なマッピングを示します。
| モダリティ | エンドポイント | 呼び出し方 |
|---|---|---|
| テキスト / チャット | POST /api/v1/chat/completions | messages アレイ |
| 画像入力(ビジョン) | POST /api/v1/chat/completions | image_url コンテンツタイプ |
| POST /api/v1/chat/completions | file コンテンツタイプ | |
| オーディオ入力 | POST /api/v1/chat/completions | input_audio コンテンツタイプ |
| ビデオ入力 | POST /api/v1/chat/completions | video_url コンテンツタイプ |
| 画像生成 | POST /api/v1/images | プロンプトを入力、base64 形式の画像を出力 |
| 動画生成 | POST /api/v1/videos (非同期) | プロンプトを送信してジョブ ID を取得し、ポーリング |
| テキスト読み上げ | POST /api/v1/audio/speech | テキストを入力、MP3/PCM バイト列を出力 |
Transcription (STT)
POST /api/v1/audio/transcriptions
base64 形式の音声を入力し、JSON 形式のテキストと使用量情報を取得します。
Embeddings
POST /api/v1/embeddings
text または text+image を入力し、ベクトルデータを出力します。

これら 5 つのモダリティは /chat/completions エンドポイントで実行され、メッセージ配列内のコンテンツタイプを変更するだけで対応可能です。一方、残りの 5 つは呼び出しのパターンが異なるため、それぞれ専用のエンドポイントを備えています。画像生成ではプロンプトに加え、解像度やアスペクト比、出力形式といったパラメータを指定し、base64 形式の画像を返します。動画生成は非同期処理となり、ジョブの状態を確認するためにポーリングが必要です。音声認識と文字起こしは生のオーディオバイトを扱い、埋め込み(embeddings)では完成したテキストではなくベクトルデータを返します。単一のプロバイダーがこれらすべてを提供しているわけではないため、ドキュメントでこれらを並列して解説することは稀です。
有料契約をする前にマルチモーダル入力をテストすることも可能です。無料枠 ではクレジットカードの登録不要で利用でき、無料モデルは日間のレート制限が設定されていますが、クレジットを追加するとこの制限は緩和されます。これだけで、ビジョンモデルに画像を送信したり、バッチ処理で埋め込みを生成したりするテストには十分です。
各モダリティの使用場面
同じメディアタイプ内であっても、「生成」と「理解」は異なるタスクであり、どのエンドポイントを使用するかは目的によって異なります。
画像:生成と理解の違い。 新しい画像が必要な場合は画像生成を、分析したい画像がある場合は画像入力を利用します。生成機能は、テキストプロンプトから資産やモックアップ、イラストを作成するもので、POST リクエストで専用エンドポイント /api/v1/images を呼び出します。必要に応じて参照画像を指定し、画像同士の処理(image-to-image)も可能です。一方、ビジョン入力はその逆の流れです。画像 URL を /chat/completions に送信すると、モデルが OCR 実行、説明生成、または物体検出を行います。詳細は 画像生成ドキュメント の完全ガイドをご覧ください。
動画:入力と生成の違い。 クリップの作成には非同期エンドポイント /videos を、理解するにはチャット内で video_url を使用します。動画生成ではプロンプトを送信し、ジョブ ID が返されるため、クリップが完成するまでポーリング(待機確認)を行います。解像度やアスペクト比、再生時間などは設定可能です。一方、動画の理解機能では、動画対応モデルに video_url を送信して分析させます。これにより、行動認識や物体検出などが可能です。詳しくは 動画生成発表ページ をご覧ください。
オーディオと音声:出力と分析の違い。
音声の出力やチャットでの音声入力による分析には、それぞれ /audio/speech エンドポイントを使用します。テキストから音声への変換(Text-to-Speech)では、テキストを /api/v1/audio/speech に送信し、OpenAI のオーディオ互換エンドポイントを介して MP3 または PCM バイト形式で返却されます。これにより、OpenAI 公式のクライアントライブラリをそのまま利用可能です。
一方、音声分析(感情分析やコンテンツ解析など)を行う場合は、音声入力を /chat/completions エンドポイントに input_audio コンテンツタイプとして含めて送信します。詳細は オーディオ API の発表記事 をご覧ください。
埋め込み(Embeddings):検索と類似度計算。
生成ではなく、データ取得や類似度判定が必要な場合に埋め込み機能を使用します。埋め込みドキュメント によると、主な用途は以下の 6 つです。
- RAG(検索拡張生成)
- セマンティック検索
- レコメンデーション
- クラスタリング
- 重複検出
- 異常検知
一度のリクエストで多数の入力をバッチ処理できるほか、一部のモデルではテキストと画像を同時に指定して単一の結合ベクトルを生成することも可能です(例:nvidia/llama-nemotron-embed-vl-1b-v2)。
文字起こし:音声からテキストへ。
音声認識には /audio/transcriptions エンドポイントを使用します。Base64 でエンコードされた音声データを送信すると、文字起こしされたテキストと利用統計を含む JSON が返されます。この機能は会議の議事録作成、音声コマンドの実行、字幕生成などに適しています。
埋め込みや画像呼び出しでもルーティングやフェイルオーバーは動作しますか?
はい、チャット呼び出しで使用しているのと同じプロバイダーオブジェクトを、埋め込み(embeddings)呼び出しでも同じように使用できます。プロバイダーの順序、自動フェイルオーバー、データ収集ポリシー、コストやレイテンシーによるソートもすべて同一です。
埋め込みドキュメント に記載されている正確な構造は以下の通りです:
{
"model": "openai/text-embedding-3-small",
"input": "Your text here",
"provider": {
"order": ["openai", "azure"],
"allow_fallbacks": true,
"data_collection": "deny"
}
}

ルーティング制御は、専用画像エンドポイントにも適用されます。/api/v1/images エンドポイントでは provider.order、provider.allow_fallbacks、provider.only、provider.ignore、provider.sort を受け付けるため、チャット呼び出しと同様に、画像生成呼び出しでもフェイルオーバーや順序制御、コスト・レイテンシーによるソートが同じように機能します。
複数のプロバイダー が提供する埋め込みモデルでは、最初のプロバイダーでエラーが発生した場合に、自動的に別のプロバイダーへフェイルオーバーできます。このクロスプロバイダー間のフェイルオーバー機能は、埋め込み、画像、音声、チャットすべてにおいて プロバイダーオブジェクト を通じて共通して利用可能です。
OpenRouter の価格設定 ではプロバイダーごとの料金を明示的にマークアップしていません。モデルカタログに記載されているレートがそのまま請求額となります。"ゼロ・コンプリッション・インシュアランス(Zero Completion Insurance)" により、実行に失敗したリクエストは課金されません。つまり、フェイルオーバー後に完了しなかったリクエストには一切費用がかかりません。この仕組みはすべてのモダリティで適用されます。
統合によって実際に何が変わるのか
API キーは一つ、請求書も一つ、すべてのモダリティ(テキスト、画像、音声など)でリクエスト形式が統一されます。
同じ Bearer トークンで、ビジョン機能の呼び出し、音声合成(TTS)、埋め込みベクトルの生成が可能になります。プロバイダーごとに別々のキー管理 vault を用意する必要も、モダリティごとに個別にオンボーディングを行う手間もありません。例えば RAG(検索拡張生成)機能を追加する場合でも、すでに持っている API キーを使って /embeddings エンドポイントを呼び出すだけで済みます。
請求書の統合により、各モダリティの利用状況はすべて OpenRouter の単一の明細書として、カタログ価格で集約されます。画像生成のコストと埋め込みベクトルのコストを別々の CSV をエクスポートして比較する手間がなくなり、一つの場所で把握できます。この「照合作業の摩擦」こそが、r/ShowYourApp で活動するビルダーたちが直面した課題です。
プラン設計で考慮すべき制限は何か
各モダリティには、構築前に知っておくべき制約が存在します。ここでは、本サービスの現在の制限を明確に示しています。これにより、本番環境で不意に壁にぶつかるのではなく、事前に設計段階で対策を講じることができます。
| 制限項目 | モダリティ | あなたへの影響 |
|---|---|---|
| ストリーミング非対応 | 埋め込みベクトル (Embeddings) | レスポンスはトークン単位ではなく、完結して返されます。同期処理を前提に設計してください。 |
| 出力の決定性 | 埋め込みベクトル (Embeddings) | 同じ入力であれば常に同じベクトルが生成されます。キャッシュ戦略を積極的に活用しましょう。 |
| Base64 エンコード必須 | オーディオ入力 | URL を指定して音声ファイルを渡すことはできません。ローカルのファイルは事前にエンコードする必要があります。 |
| プロバイダー固有の URL 制限 | ビデオ入力 | URL のサポート状況はプロバイダーによって異なります。例えば、AI Studio 上の Gemini は YouTube リンクのみを受け付けます。 |
モデルごとのサポート状況
すべてのモデルがすべてのモダリティ(データ形式)をサポートしているわけではありません。コンテンツに応じて自動的にフィルタリングされます。
無料枠のレート制限
無料プランのモデルは、1 日の利用上限が低く設定されていますが、クレジットを追加することで上限を引き上げることができます。
統一 API が真価を発揮するのは、複数のメディアタイプを扱う必要がある場合や、モデルの切り替えをコードの一部変更だけで完結させたい場合、あるいはプロバイダーの一時的な障害で機能が停止しないようにしたい場合です。もしあなたのアプリが、単一のプロバイダーから提供される汎用モデルに対するチャット機能のみで構成されているなら、直接統合する方がシンプルであり、統一 API のメリットは限定的になります。
最初の呼び出しから始める
ベース URL に対して、1 つの埋め込み(embeddings)リクエストを送信します。
import requests
response = requests.post(
"https://openrouter.ai/api/v1/embeddings",
headers={
"Authorization": "Bearer <OPENROUTER_API_KEY>",
"Content-Type": "application/json",
},
json={
"model": "openai/text-embedding-3-small",
"input": "The quick brown fox jumps over the lazy dog",
},
)
print(response.json()["data"][0]["embedding"][:5])import { OpenRouter } from '@openrouter/sdk';
const openRouter = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });
const response = await openRouter.embeddings.generate({
model: 'openai/text-embedding-3-small',
input: 'The quick brown fox jumps over the lazy dog',
});console.log(response.data[0].embedding);
curl https://openrouter.ai/api/v1/embeddings \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "openai/text-embedding-3-small", "input": "The quick brown fox jumps over the lazy dog"}'
ここからは、マルチモーダル概要 を参照して各モダリティごとに詳しく掘り下げるか、出力形式別のモデル一覧 から各呼び出しに最適なモデルを探してください。
よくある質問
画像生成、埋め込み(エンベディング)、文字起こしを一つの API で扱えますか?
はい。これらすべては、同じ API キーを用いて https://openrouter.ai/api/v1 の基本 URL を通じて実行されます。
- 画像生成には専用の
/imagesエンドポイント - 埋め込み(エンベディング)には
/embeddings - 文字起こしには
/audio/transcriptions
それぞれを使用する際は、エンドポイントとコンテンツタイプを変更するだけで、統合ロジックや認証方式、API キーの変更は不要です。
OpenRouter は埋め込み(エンベディング)に対応していますか?
はい。埋め込み機能は POST /api/v1/embeddings を通じて提供され、RAG(検索拡張生成)、セマンティック検索、レコメンデーション、クラスタリング、重複検出、異常検出などの用途でベクトルを返します。
一度のリクエストで複数の入力をバッチ処理できるほか、一部のモデルではテキストと画像を組み合わせて一つのベクトルとして出力することも可能です。
チャットエンドポイントを使用するモダリティと、専用エンドポイントを使用するモダリティの違いは?
テキスト、画像、PDF、音声、動画の入力はいずれも /chat/completions エンドポイントを使用し、違いはコンテンツタイプのみです。一方、画像生成(/images)、動画生成(/videos)、テキストから音声への変換(/audio/speech)、文字起こし(/audio/transcriptions)、埋め込みベクトル取得(/embeddings)については、呼び出しの形式が異なるため専用のエンドポイントが用意されています。具体的には、プロンプトからの画像生成リクエストや非同期ジョブ、生音声データのやり取り、あるいは完了結果ではなくベクトルが返却される処理に対応するためです。
多様な入力をサポートする無料 AI API はありますか?
はい、OpenRouter ではクレジットカード登録不要で無料枠を提供しています。無料モデルは1日の利用回数制限が低めに設定されていますが、クレジットを追加すると制限が緩和されます。これにより、有料契約を決定する前に画像の送信や埋め込みベクトルの生成、あるいは他のモダリティの実験が可能になります。
1 つの埋め込みリクエストでテキストと画像を同時に送れますか?
はい、多様な入力を扱う埋め込みモデルを使えば可能です。入力データを text と image_url を含む content アレイに包み込むことで、両者の情報を統合した単一のベクトルが返されます。例えば nvidia/llama-nemotron-embed-vl-1b-v2 は、テキストと画像を同じ検索空間で扱いたい場合に有用なモデルです。
プロバイダーのルーティングやフェイルオーバー機能は、埋め込みや画像生成呼び出しでも有効ですか?
はい、有効です。埋め込み、画像、音声、チャット呼び出しすべてに、同じプロバイダー制御(順序指定、フォールバック許可、コストやレイテンシーによるソート)が適用されます。もしプロバイダー側でエラーが発生した場合、そのモデルを担当する次のプロバイダーへ自動的に切り替わり、失敗した実行に対しては課金されません。
原文を表示
You’re building an app that needs to answer questions in chat, generate product images, search a knowledge base, and turn voice memos into text. The default path is 4 provider SDKs, 4 billing relationships, and 4 auth schemes to wire up before you write a line of feature code. One developer on r/Bard went looking for a unified API for LLMs, image, and video generation models. Another on r/ShowYourApp built the thing themselves and reported that an all-in-one AI API was way harder than expected once text, image, video, TTS, STT, and embeddings all had to coexist.
On OpenRouter, every one of those modalities runs through a single OpenAI-compatible base URL: https://openrouter.ai/api/v1. You set it once. After that, you change the model string and the content type. The catalog spans 400+ models across 70+ providers, and the same routing controls that protect a chat call protect an embeddings call.
Tl;dr
- Set one base URL (https://openrouter.ai/api/v1) and call image, video, audio, embeddings, and transcription through it. Switch modality by changing the model string and the content type.
- Most input modalities ride the /chat/completions endpoint. Five have dedicated endpoints: /images, /videos, /audio/speech, /audio/transcriptions, and /embeddings.
- The same provider routing object (failover, data_collection: "deny", cost/latency sort) works on an embeddings call exactly as it does on a chat call.
- One API key, one bill, one OpenAI-shaped request format across all 5 modalities. We don’t mark up provider pricing, and failed requests aren’t billed.
- Real limits to plan around: embeddings don’t stream, audio input is base64 only, and video URL support is provider-specific.
Can one API handle image, video, audio, embeddings, and transcription?
Yes. One base URL serves every modality, and you switch between them by changing the model string and the request content type. Set https://openrouter.ai/api/v1 as your base URL, pass your API key as a Bearer token, and you reach the full catalog through one OpenAI-compatible interface.
Wiring up 4 provider SDKs means each provider brings its own auth refresh, retry and backoff semantics, rate-limit headers, streaming format, and error schema. You write that glue 4 times, maintain it 4 times, and a change from one provider only ever fixes its own corner.
We’re a drop-in replacement for the OpenAI Chat API, so the same request format carries across every modality that rides /chat/completions, and the TTS endpoint follows the OpenAI Audio API. The dedicated endpoints (image generation, video generation, transcription, and embeddings) each have their own request shape, but our official SDKs (@openrouter/sdk for TypeScript, openrouter for Python) wrap all of it behind one interface.
Which endpoint does each modality use?
Most input modalities ride /chat/completions and differ only by content type. Five modalities have dedicated endpoints. Here’s the full map, grounded in our multimodal overview and embeddings reference.
ModalityEndpointHow you call it
Text / chatPOST /api/v1/chat/completionsmessages array
Image input (vision)POST /api/v1/chat/completionsimage_url content type
PDFPOST /api/v1/chat/completionsfile content type
Audio inputPOST /api/v1/chat/completionsinput_audio content type
Video inputPOST /api/v1/chat/completionsvideo_url content type
Image generationPOST /api/v1/imagesprompt in, base64 images out
Video generationPOST /api/v1/videos (async)submit prompt, get job ID, poll
Text-to-speechPOST /api/v1/audio/speechtext in, MP3/PCM bytes out
Transcription (STT)POST /api/v1/audio/transcriptionsbase64 audio in, JSON text + usage out
EmbeddingsPOST /api/v1/embeddingstext or text+image, vectors out

Five of these modalities run on /chat/completions and change only the content type in the message array. Five have their own endpoints because their call shape is different: image generation takes a prompt plus image-specific knobs (resolution, aspect ratio, output format) and returns base64 images, video generation is asynchronous (you poll a job), speech and transcription move raw audio bytes, and embeddings return vectors instead of completions. Single-provider docs rarely lay this out side by side, because no single provider serves all of them.
You can test multimodal inputs without paying. The free tier needs no credit card, and free models run under low daily rate limits that rise once you’ve added credits. That’s enough to send an image to a vision model or generate a batch of embeddings before you commit.
When should you use each modality?
Generation and understanding are different tasks even within the same media type, and the endpoint you reach for depends on which one you’re doing.
Image: generation vs. understanding. Use image generation when you need a new image, and image input when you have one to analyze. Generation produces assets, mockups, and illustrations from a text prompt through a POST to the dedicated /api/v1/images endpoint, with optional reference images for image-to-image work. Vision input goes the other way: you send an image_url on /chat/completions, and the model does OCR, description, or detection. See the image generation docs for the full walkthrough.
Video: input vs. generation. Use the async /videos endpoint to produce clips and video_url on chat to understand them. Video generation submits a prompt and returns a job ID you poll until the clip is ready, with configurable resolution, aspect ratio, and duration. Video understanding sends a video_url to a video-capable model for analysis, action recognition, or object detection. More in the video generation announcement.
Audio and speech: output vs. analysis. Use /audio/speech for voice output and audio input on chat for analysis. Text-to-speech sends text to /api/v1/audio/speech and returns MP3 or PCM bytes through an OpenAI Audio-compatible endpoint, so OpenAI client libraries work against it. Audio input rides /chat/completions with the input_audio content type for tasks like sentiment or content analysis. Details in the audio APIs announcement.
Embeddings: retrieval and similarity. Use embeddings when you need retrieval or similarity, not generation. The embeddings docs name 6 jobs: RAG, semantic search, recommendations, clustering, duplicate detection, and anomaly detection. You can batch many inputs in one request, and some models accept text and an image together to produce a single joint vector (nvidia/llama-nemotron-embed-vl-1b-v2 is one).
Transcription: speech to text. Use /audio/transcriptions for speech-to-text. You send base64-encoded audio and get back JSON with the transcribed text plus usage statistics. It fits meeting notes, voice commands, and captioning.
Do routing and failover work for embeddings and image calls too?
Yes. The same provider object you use on a chat call works identically on an embeddings call: provider order, automatic failover, data-collection policy, and cost or latency sort. Here’s the exact shape from the embeddings docs:
{
"model": "openai/text-embedding-3-small",
"input": "Your text here",
"provider": {
"order": ["openai", "azure"],
"allow_fallbacks": true,
"data_collection": "deny"
}
}
The routing controls carry to the dedicated image endpoint too: /api/v1/images accepts provider.order, provider.allow_fallbacks, provider.only, provider.ignore, and provider.sort, so failover, ordering, and cost/latency sort work the same way on an image generation call as on a chat call.
An embedding model served by more than one provider can fall back from one to another when the first returns an error. The same cross-provider failover applies to embeddings, image, audio, and chat alike through the provider object.
We don’t mark up provider pricing: the rate in the model catalog is what you pay. Zero Completion Insurance means a failed run isn’t billed, so a request that fails over and never completes costs nothing. That holds across modalities.
What do you actually save by consolidating?
One API key, one bill, one request format across every modality.
The same Bearer token authorizes a vision call, a TTS call, and an embeddings call. There’s no separate key vault per provider and no per-modality onboarding. When you add a new capability, say you start doing RAG, you call /embeddings with the key you already have.
Consolidated billing means usage across modalities lands on a single OpenRouter statement at catalog rates. You can compare what image generation cost versus embeddings in one place, rather than exporting CSVs from 4 dashboards. That reconciliation friction is exactly what the r/ShowYourApp builder ran into when the all-in-one stack got harder than expected.
What are the limits to plan around?
Each modality has constraints worth knowing before you build. These are our own current limits, stated plainly so you can design around them rather than discover them in production.
LimitModalityWhat it means for you
No streamingEmbeddingsResponses come back complete, not token by token. Plan synchronous handling.
Deterministic outputEmbeddingsSame input gives the same vector. Cache aggressively.
Base64 onlyAudio inputAudio can’t be passed by URL. Encode local files first.
Provider-specific URLsVideo inputURL support varies. Gemini on AI Studio accepts only YouTube links.
Model-by-model supportAllNot every model supports every modality. We auto-filter by content.
Free-tier rate limitsAllFree models have low daily limits that rise once you add credits.
The unified API earns its place when you need more than one media type, when swapping models is a one-string change, or when a provider outage shouldn’t take your feature down. If your entire app is a single chat feature against one general-purpose model from one provider, a direct integration is simpler and the consolidation upside is thinner.
Start with one call
Send a single embeddings request against the base URL.
import requests
response = requests.post(
"https://openrouter.ai/api/v1/embeddings",
headers={
"Authorization": "Bearer <OPENROUTER_API_KEY>",
"Content-Type": "application/json",
},
json={
"model": "openai/text-embedding-3-small",
"input": "The quick brown fox jumps over the lazy dog",
},
)
print(response.json()["data"][0]["embedding"][:5])import { OpenRouter } from '@openrouter/sdk';
const openRouter = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });
const response = await openRouter.embeddings.generate({
model: 'openai/text-embedding-3-small',
input: 'The quick brown fox jumps over the lazy dog',
});
console.log(response.data[0].embedding);curl https://openrouter.ai/api/v1/embeddings \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "openai/text-embedding-3-small", "input": "The quick brown fox jumps over the lazy dog"}'From here, go deeper per modality with the multimodal overview, or browse models by output modality to find what fits each call.
Frequently asked questions
Can I use one API for image generation, embeddings, and transcription?
Yes. All three run through our base URL at https://openrouter.ai/api/v1, with one API key. Image generation uses the dedicated /images endpoint, embeddings use /embeddings, and transcription uses /audio/transcriptions. You change the endpoint and content type, not the integration, the auth, or the API key.
Does OpenRouter support embeddings?
Yes. Embeddings run through POST /api/v1/embeddings and return vectors for RAG, semantic search, recommendations, clustering, duplicate detection, and anomaly detection. You can batch multiple inputs in one request, and some models accept text and an image together for a joint vector.
Which modalities use the chat endpoint vs. a dedicated endpoint?
Text, image input, PDF, audio input, and video input all use /chat/completions and differ only by content type. Image generation (/images), video generation (/videos), text-to-speech (/audio/speech), transcription (/audio/transcriptions), and embeddings (/embeddings) use dedicated endpoints, because their call shapes differ: prompt-to-image requests, async jobs, raw audio bytes, or returned vectors instead of completions.
Are there free AI APIs that support multimodal inputs?
Yes. We have a free tier at OpenRouter, no credit card required. Free models run under low daily rate limits that rise once you’ve added credits, which is enough to send images, generate embeddings, or test other modalities before you commit.
Can I send text and an image in one embeddings request?
Yes, with multimodal embedding models. You wrap the input in a content array containing text and image_url objects, and the model returns a single joint vector that captures both. nvidia/llama-nemotron-embed-vl-1b-v2 is one model, useful when you want text and images to share a single retrieval space.
Do provider routing and failover work for embeddings and image calls too?
Yes. The same provider routing controls (order, allow_fallbacks, cost/latency sort) apply to embeddings, image, audio, and chat calls. If a provider errors, the call falls over to the next one serving that model, and a failed run is never billed.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み