相容 OpenAI——沿用你現有的 SDK
https://api.orcarouter.ai/v1https://api.orcarouter.aifrom openai import OpenAI
client = OpenAI(
base_url="https://api.orcarouter.ai/v1",
api_key="$ORCAROUTER_API_KEY",
)
response = client.chat.completions.create(
model="google/gemini-flash-latest",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)max_tokensresponse_formatseedstopstructured_outputstemperaturetool_choicetoolstop_pinclude_reasoningreasoning| 輸入 / 1M tokens | $0.500 |
| 輸出 / 1M tokens | $3.00 |
| 快取讀取 / 1M | $0.100 |
| 貨幣 | USD |
基於標價的估算
僅為估算——實際 Token 數取決於供應商的分詞器。
@misc{orcarouter_gemini_flash_latest,
title = {google/gemini-flash-latest API},
author = {google},
year = {n.d.},
howpublished = {OrcaRouter},
url = {https://www.orcarouter.ai/models/google/gemini-flash-latest}
}google. (n.d.). google/gemini-flash-latest API. OrcaRouter. https://www.orcarouter.ai/models/google/gemini-flash-latest