OpenRouter の meta-llama/llama-3.1-8b-instruct モデル API,$0.05 / $0.08(100万トークンあたり),コンテキスト 131,072 トークン。curl・Python・JavaScript のコード例とライブテスト。
Meta's latest class of model (Llama 3.1) launched with a variety of sizes & flavors. This 8B instruct-tuned version is fast and efficient. It has demonstrated strong performance compared to...
- 種類
- モデル
- プロバイダー
- OpenRouter
- モデル ID
meta-llama/llama-3.1-8b-instruct- 料金
- 有料
- 入力 / 出力の価格
- $0.05 / $0.08(100万トークンあたり)
- キーなしで利用
- いいえ
- キーの環境変数
OPENROUTER_API_KEY- ベース URL(OpenAI 互換)
https://openrouter.ai/api/v1- コンテキスト
- 131,072 トークン
- 入力
- テキスト
- 機能
- JSON 出力, ツール呼び出し
- 開発者の評価
- まだ評価がありません
- ドキュメント
- https://openrouter.ai/meta-llama/llama-3.1-8b-instruct
コード例
cURL
curl https://openrouter.ai/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-d '{"model":"meta-llama/llama-3.1-8b-instruct","messages":[{"role":"user","content":"こんにちは。一文で自己紹介してください。"}]}'Python
# pip install openai
import os
from openai import OpenAI
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"])
r = client.chat.completions.create(
model="meta-llama/llama-3.1-8b-instruct",
messages=[{"role": "user", "content": "こんにちは。一文で自己紹介してください。"}],
)
print(r.choices[0].message.content)JavaScript
// npm install openai
import OpenAI from 'openai'
const client = new OpenAI({ baseURL: 'https://openrouter.ai/api/v1', apiKey: process.env.OPENROUTER_API_KEY })
const r = await client.chat.completions.create({
model: 'meta-llama/llama-3.1-8b-instruct',
messages: [{ role: 'user', content: 'こんにちは。一文で自己紹介してください。' }],
})
console.log(r.choices[0].message.content)
人気の検索
よくある質問
Meta: Llama 3.1 8B Instruct の API は無料ですか?
いいえ。Meta: Llama 3.1 8B Instruct は有料の API です($0.05 / $0.08(100万トークンあたり))。
コードから Meta: Llama 3.1 8B Instruct を呼び出すには?
Meta: Llama 3.1 8B Instruct は https://openrouter.ai/api/v1 で OpenAI 互換 API を提供しています。このベース URL を指定すれば、任意の OpenAI SDK(Python、JavaScript など)で利用できます。 モデル ID:meta-llama/llama-3.1-8b-instruct。 ストリーミング・JSON・再試行に対応したすぐ使えるコードを開発者ツールキットで提供しています。
Meta: Llama 3.1 8B Instruct のコンテキストウィンドウは?
Meta: Llama 3.1 8B Instruct は最大 131,072 トークンのコンテキスト(プロンプトと履歴)を扱えます。
Meta: Llama 3.1 8B Instruct の代替は?
カタログ内の類似 API:Llama-3.2-3B-Instruct · Parasail, Llama-3.1-8B-Instruct · Amazon Bedrock, Llama-3.1-8B-Instruct · CoreWeave, Llama-3.1-8B-Instruct · DeepInfra, Llama-3.1-8B-Instruct · Groq。
代替候補
- Llama-3.2-3B-Instruct · Parasail — 有料
- Llama-3.1-8B-Instruct · Amazon Bedrock — 有料
- Llama-3.1-8B-Instruct · CoreWeave — 有料
- Llama-3.1-8B-Instruct · DeepInfra — 有料
- Llama-3.1-8B-Instruct · Groq — 有料
- Llama-3.3-70B-Instruct · Cloudflare — 有料
- Llama-3.3-70B-Instruct · CoreWeave — 有料
- Llama-3.3-70B-Instruct · Groq — 有料
- Llama-4-Scout-17B-16E-Instruct · DeepInfra — 有料
- Llama-3.1-70B-Instruct · Amazon Bedrock — 有料
- Llama-4-Maverick-17B-128E-Instruct · Parasail — 有料
- Llama-Guard-4-12B · DeepInfra — 有料