PulseAugur
中
实时 12:35:56
English(EN) Your DeepInfra baseURL is wrong: it needs /v1/openai, not /v1

DeepInfra API 错误:错误的基 URL 导致开发人员出现 404 错误

使用 DeepInfra 的 OpenAI 兼容 API 的开发人员遇到的一个常见错误是基 URL 不正确,导致 404 错误。问题在于 DeepInfra 的聊天补全 API 端点位于 `/v1/openai/chat/completions`,但开发人员经常错误地将 `/v1` 用作基 URL。这会导致 API 客户端构建一个不正确的路径,例如 `/v1/chat/completions`,而该路径不存在。修复方法需要将 `/openai` 追加到基 URL,使其成为 `https://api.deepinfra.com/v1/openai`。此外,文档还澄清了模型 ID 遵循 Hugging Face 的约定(例如 `deepseek-ai/DeepSeek-V4-Flash`),并且 API 响应中提供了使用成本估算。 AI

影响 通过 API 与 AI 模型集成的开发人员需要了解特定的端点配置,以避免常见的集成错误。

排序理由 此条目描述了一个特定的技术问题及其针对特定 API 服务的解决方案,符合面向开发人员的问题解决的“工具”类别。

在 dev.to — LLM tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

DeepInfra API 错误:错误的基 URL 导致开发人员出现 404 错误

本文如何被排名

Signal score
0 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
此条目描述了一个特定的技术问题及其针对特定 API 服务的解决方案,符合面向开发人员的问题解决的“工具”类别。
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
product, infra
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
62 days old
Aged out of breaking-news scoring windows; ranking reflects the durable signal from the full source set.

完整方法见我们的编辑标准。

报道来源 [1]

  1. dev.to — LLM tag TIER_1 English(EN) · Rachel Vectle ·

    您的 DeepInfra baseURL 错误:需要 /v1/openai,而不是 /v1

    <p>Every request 404s and your API key is fine. Your baseURL is the bug.<br /> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="c1">// wrong: this is what the muscle memory gets you</span> <span class="kd">const</span> <span clas…