前言
前些天在网上找免费API的AI,找到了
普通用户注册后有免费的额度,每个月都有
9,000,000input tokens/月
3,000,000output tokens/月
获取API Key
在https://internlm.intern-ai.org.cn/api/tokens获取,需要手机号注册,注册后可以直接创建API Key,但是每6个月需要更换,否则会失效。

申请更高限流
默认是限制每分钟只能调用30次,每分钟最大50000Tokens,但是可以在https://internlm.intern-ai.org.cn/api/strategy申请更高限流
我目前申请到了每分钟60次,最大300000Tokens。

模型列表
调用模型
BaseUrl: https://chat.intern-ai.org.cn/api/v1/
from openai import OpenAI
client = OpenAI(
api_key="eyJ0eXBlIjoiSl...请填写准确的 token!", # 此处传token,不带Bearer
base_url="https://chat.intern-ai.org.cn/api/v1/",
)
chat_rsp = client.chat.completions.create(
model="intern-latest",
messages=[{"role": "user", "content": "hello"}],
)
for choice in chat_rsp.choices:
print(choice.message.content)