QUICKSTART

接続ガイド

接続先・APIキー・モデル名の3つを設定すれば準備完了です。

OPENAI COMPATIBLE

OpenAI形式 / Codex

https://api.ai.portomo.com/v1

Base URLには /v1 を含めます。

ANTHROPIC COMPATIBLE

Anthropic形式 / Claude Code

https://api.ai.portomo.com

Base URLに /v1 は付けません。

OPENAI COMPATIBLE

Cursor

https://api.ai.portomo.com/v1

Base URLには /v1 を含めます。

そのまま使える接続サンプル

YOUR_API_KEY を発行したキーに置き換えてください。

Terminal · bash / zsh
export AIGATEWAY_API_KEY="YOUR_API_KEY"

curl https://api.ai.portomo.com/v1/chat/completions \
  -H "Authorization: Bearer $AIGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "こんにちは"}],
    "max_tokens": 256
  }'
DECISION MODELS

判断用モデル(API専用)

入力と質問から確率・選択・点数を返します。クライアントアプリのモデル選択には表示されません。モデルに対応する以下のAPIを使用してください。

/v1/decisions

gpt-6-luna-decisions はテキストと画像に対応します。ストリーミングには対応しません。

Terminal · bash / zsh
export AIGATEWAY_API_KEY="YOUR_API_KEY"

curl https://api.ai.portomo.com/v1/decisions \
  -H "Authorization: Bearer $AIGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna-decisions",
    "input": "All tests passed; a security review is still pending.",
    "questions": [
      {"type": "predicate", "name": "ready", "instructions": "Is this change ready to deploy without further review?"}
    ]
  }'

質問は配列で指定し、種類は predicate・choice・score。画像は input 内のメッセージに input_image とBase64のdata URLを指定します。質問は32個まで、本文は4 MiBまでです。通常のChat CompletionsやResponses APIには送れません。

/v1/systemone

clef・clef-flash・jev-latest は状況(state)と質問オブジェクトを指定します。

Terminal · bash / zsh
export AIGATEWAY_API_KEY="YOUR_API_KEY"

curl https://api.ai.portomo.com/v1/systemone \
  -H "Authorization: Bearer $AIGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "clef",
    "state": "All tests passed; a security review is still pending.",
    "questions": {
      "ready": {"type": "noul", "instructions": "Is this change ready to deploy without further review?"},
      "next": {"type": "choice", "instructions": "What should happen next?",
               "criteria": {"deploy": "Deploy now", "review": "Wait for the security review"}},
      "risk": {"type": "score", "instructions": "How risky is deploying now?", "criteria": ["low", "medium", "high"]}
    }
  }'

質問の種類は noul(はい/いいえの確率)・choice(選択肢)・score(2〜10段階の点数)。1回の要求で質問は32個まで、本文は262,144バイトまでです。

返る確率は判断の目安で、そのまま実行の許可として扱わないでください。usage.cost は残高から引いた額(USD)です。

うまく接続できないとき

401・403 はAPIキーや残高、404 は接続先とAPIパスを確認してください。モデル名は「モデル・料金」に表示されているモデルIDを使います。APIキーをブラウザーのJavaScriptに埋め込まないでください。