AgnesAI-Models icon indicating copy to clipboard operation
AgnesAI-Models copied to clipboard

[API]: Image 2.1 Flash以及Agnes-Video-V2.0到哪儿申请API?

Open 91rinb18 opened this issue 5 months ago • 2 comments

Model

Image 2.1 Flash

Endpoint

https://apihub.agnes-ai.com/v1/images/generations

SDK or client

hermes agent 0.17

Minimal sanitized request


Error response

https://platform.agnes-ai.com/settings/apiKeys 申请的API是不是只能给Agnes-2.0-Flash用?
按照https://agnes-ai.com/doc/agnes-image-21-flash的说明配置
视频俺就没有测试了

Expected behavior

hermes agent给我生成一个绘画skill,但接口 /v1/images/generations 返回了 404 route not found。 改成v1/chat/completions 结果显示 401 Unauthorized:无效的令牌

Actual behavior

hermes agent给我生成一个绘画skill,但接口 /v1/images/generations 返回了 404 route not found。 改成v1/chat/completions 结果显示 401 Unauthorized:无效的令牌

Is this reproducible?

Yes

91rinb18 avatar Jun 22 '26 15:06 91rinb18

@91rinb18 感谢反馈。

https://platform.agnes-ai.com/settings/apiKeys 里申请的 API Key 不是只给 agnes-2.0-flash 使用的,也支持 Agnes 的图片模型和视频模型,例如:

  • Text:agnes-2.0-flash
  • Image:agnes-image-2.1-flash
  • Video:支持 Agnes 视频模型,具体模型名和参数请参考对应文档

图片生成请确认配置如下:

  • Base URL:https://apihub.agnes-ai.com/v1
  • Endpoint:/images/generations
  • Full URL:https://apihub.agnes-ai.com/v1/images/generations
  • Model:agnes-image-2.1-flash
  • Header:Authorization: Bearer <YOUR_API_KEY>

你遇到的两个报错含义分别是:

  • 404 route not found:通常是客户端最终拼出来的请求 URL 不正确,比如 Base URL 和 Endpoint 被重复拼接、路径缺少 /v1,或者请求到了错误路径。
  • 401 Unauthorized: invalid token:通常是 API Key 没有正确传入、Key 无效,或者 Hermes Agent 实际请求时使用的不是你配置的 Key。

建议你先用下面这个最小 curl 验证 Key 和图片接口是否正常:

curl https://apihub.agnes-ai.com/v1/images/generations \
  -H "Authorization: Bearer $AGNES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "agnes-image-2.1-flash",
    "prompt": "A cute cat sitting on a sofa",
    "size": "1024x1024"
  }'

如果 curl 可以正常返回,但 Hermes Agent 里仍然报错,请补充一下脱敏后的 Hermes Agent skill/config,以及 Hermes Agent 最终生成的完整请求 URL。注意不要暴露真实 API Key。

agnesai-admin avatar Jun 23 '26 01:06 agnesai-admin

Hermes agent其实是可以让它自己写个脚本来文生图或文生视频的,但是官方的说明似乎写的不够详细,在Open WebUI中不知道具体如何设置,试了几轮也没能生成图片,基本上返回的是400,应该是参数什么的错了。

baoang avatar Jul 31 '26 20:07 baoang