Skip to content

AI でセットアップ

AI に安全でプロジェクトに合った変更を任せるときは、下の指示を 1 つコピーしてください。

PleumRouter は OpenAI 互換です。この指示は既存の SDK や統合を再利用し、変更を最小限にするよう AI に 伝えます。

3 ステップ#

  1. 01

    1. API キーを作成

    ダッシュボード → API キー でキーを作成し、安全に保管します。

  2. 02

    2. 形式を選んでコピー

    チャット型 AI には Markdown、ツールやエージェントには JSON を選び、ブロック全体をコピーします。

  3. 03

    3. 貼り付けて検証

    AI に変更案を出させたら、実際のキーは自分でサーバー側のシークレットに入れ、モデル取得と 1 回のスモークテストを確認します。

pleumrouter-setup.md

ChatGPT や Claude などの対話型 AI に指示全体を貼り付けるのに適しています。

# PleumRouter setup instructions

Use this payload to configure my existing project for PleumRouter. PleumRouter is OpenAI-compatible.

## Setup instructions
- Inspect the project's stack, server/client boundary, and existing SDK or integration before editing.
- Reuse the existing SDK, client, and integration pattern whenever possible; make the minimum necessary changes.
- Configure the PleumRouter base URL and authentication only in server-side code or server-side configuration.
- Fetch available models from GET https://apirouter.pleum.ai/v1/models at runtime before selecting one; do not guess model IDs.
- Do not introduce a new client, SDK, framework, or broad refactor solely for this setup.

## Connection
- Base URL: https://apirouter.pleum.ai/v1
- Authentication: Authorization: Bearer <API_KEY>
- API key prefix: plm_
- API key placeholder: plm_xxxxxxxxxxxxxxxx
- Create an API key: https://router.pleum.ai/keys

## Endpoints
- POST https://apirouter.pleum.ai/v1/chat/completions (path: /v1/chat/completions; auth_required=true) — Create chat completions.
- POST https://apirouter.pleum.ai/v1/messages (path: /v1/messages; auth_required=true) — Create Anthropic Messages API messages.
- POST https://apirouter.pleum.ai/v1/responses (path: /v1/responses; auth_required=true) — Create OpenAI Responses API responses.
- GET  https://apirouter.pleum.ai/v1/models (path: /v1/models; auth_required=false) — List currently available models and pricing.
- GET  https://apirouter.pleum.ai/v1/credits (path: /v1/credits; auth_required=true) — Read the remaining credit balance.
- POST https://apirouter.pleum.ai/v1/embeddings (path: /v1/embeddings; auth_required=true) — Create embeddings.
- POST https://apirouter.pleum.ai/v1/images/generations (path: /v1/images/generations; auth_required=true) — Create images.
- POST https://apirouter.pleum.ai/v1/images/edits (path: /v1/images/edits; auth_required=true) — Edit images (multipart).
- WS   wss://apirouter.pleum.ai/v1/realtime (path: /v1/realtime; auth_required=true) — OpenAI Realtime speech-to-speech WebSocket.
- POST https://apirouter.pleum.ai/v1/audio/speech (path: /v1/audio/speech; auth_required=true) — Create speech audio.
- POST https://apirouter.pleum.ai/v1/audio/transcriptions (path: /v1/audio/transcriptions; auth_required=true) — Transcribe audio.

## Model selection
- Example models only: gpt-4.1, claude-haiku-4-5, gpt-5.4-nano, gemini-3.6-flash, qwen3.8-max
- Fetch the live model catalog first: https://apirouter.pleum.ai/v1/models

## Security
- Keep `plm_xxxxxxxxxxxxxxxx` as the placeholder while this payload is pasted into an AI assistant.
- Never request, paste, or place a real API key in the AI prompt, client-side code, source files, version control, or logs.
- After the AI changes are ready, manually put the real key in server-side environment variables or approved secret storage.

## Verification
- After the real key is set server-side, fetch /v1/models and choose a returned model rather than an assumed ID.
- Run exactly one non-production smoke test through the existing server-side integration.
- Completion criteria: the smoke test returns a response, no key appears in output, and the result names the changed files and commands run.

## Billing response fields
- Charges use the currency for the account's market; do not assume a single market currency.
- `cost.krw` is a legacy field name. Its integer value represents the smallest unit of the account market's currency (KRW and JPY use whole units; BRL uses centavos).
- `cost.fx_rate` is the applied FX rate and `cost.markup_rate` is the applied markup.

## Documentation
- Authentication: https://router.pleum.ai/docs/api#auth
- Quickstart (method tabs): https://router.pleum.ai/docs
- AI SDK: https://router.pleum.ai/docs/ai-sdk
- Messages (Anthropic): https://router.pleum.ai/docs/api/messages
- Images (generate & edit): https://router.pleum.ai/docs/api/images
- Realtime (WebSocket): https://router.pleum.ai/docs/api/realtime
- Models: https://router.pleum.ai/docs/api/models
- Errors: https://router.pleum.ai/docs/api/errors
- Agent integration: https://router.pleum.ai/docs/cookbook/agent-integration
AI に貼り付けるときは plm_xxxxxxxxxxxxxxxx のプレースホルダーをそのまま残してください。 実際のキーをプロンプト、クライアント、ソース、ログに入れてはいけません。AI の変更後に、自分でサーバー側の環境変数または承認済みのシークレット保管場所にのみ設定してください。

完了条件#

  • 既存のサーバー側統合を再利用し、変更は必要なファイルだけに限定されています。
  • ライブの /v1/models 応答で返されたモデルを使い、非本番のスモークテストが 1 回成功しました。
  • AI が変更ファイル、実行コマンド、結果を報告し、出力にキーが含まれていません。

次に読む#