LLM7 提供的 codestral-latest 模型 API,$0.01 / $0.02 每百万 token,上下文 32,000 token。提供 curl、Python、JavaScript 示例及在线测试。
- 类型
- 模型
- 服务商
- LLM7
- 模型 ID
codestral-latest- 价格
- 付费
- 输入 / 输出价格
- $0.01 / $0.02 每百万 token
- 无需密钥访问
- 否
- 密钥环境变量
LLM7_API_KEY- Base URL(兼容 OpenAI)
https://api.llm7.io/v1- 上下文
- 32,000 token
- 输入
- 文本
- 开发者评分
- 暂无评分
- 文档
- https://llm7.io
代码示例
cURL
curl https://api.llm7.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LLM7_API_KEY" \
-d '{"model":"codestral-latest","messages":[{"role":"user","content":"你好,请用一句话介绍你自己。"}]}'Python
# pip install openai
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.llm7.io/v1", api_key=os.environ["LLM7_API_KEY"])
r = client.chat.completions.create(
model="codestral-latest",
messages=[{"role": "user", "content": "你好,请用一句话介绍你自己。"}],
)
print(r.choices[0].message.content)JavaScript
// npm install openai
import OpenAI from 'openai'
const client = new OpenAI({ baseURL: 'https://api.llm7.io/v1', apiKey: process.env.LLM7_API_KEY })
const r = await client.chat.completions.create({
model: 'codestral-latest',
messages: [{ role: 'user', content: '你好,请用一句话介绍你自己。' }],
})
console.log(r.choices[0].message.content)
热门搜索
常见问题
LLM7 · codestral-latest API 免费吗?
否:LLM7 · codestral-latest 是付费 API($0.01 / $0.02 每百万 token)。
如何在代码中调用 LLM7 · codestral-latest?
LLM7 · codestral-latest 在 https://api.llm7.io/v1 提供兼容 OpenAI 的 API:使用任意 OpenAI SDK(Python、JavaScript 等)并设置该基础 URL 即可。 模型标识:codestral-latest。 开发者工具箱中提供了即用代码(流式输出、JSON、重试)。
LLM7 · codestral-latest 的上下文窗口有多大?
LLM7 · codestral-latest 最多支持 32,000 个令牌的上下文(提示词和历史记录)。