Azure 调用API问题

佬们,没看明白为什么报错


19 Likes

接口或者 APIKey 填错了


我就用的他的代码示例錒

贴代码看看呢,我记得他给的是跑不通的

import os

from azure.ai.inference import ChatCompletionsClient

from azure.ai.inference.models import SystemMessage, UserMessage

from azure.core.credentials import AzureKeyCredential



endpoint = "https://deepseekchi11i7665463441.services.ai.azure.com/models"

model_name = "MAI-DS-R1"



client = ChatCompletionsClient(

    endpoint=endpoint,

    credential=AzureKeyCredential("******"),

)



response = client.complete(

    messages=[

        SystemMessage(content="You are a helpful assistant."),

        UserMessage(content="I am going to Paris, what should I see?")

    ],

    max_tokens=2048,
    model=model_name

)



print(response.choices[0].message.content)

来个这个图

奇怪,我也用的示例代码,能通;是不是你号没了

因为朋友要用,所以部署了好几个,怎么看封号

看看你的订阅状态呢

订阅 - Microsoft Azure

搞不懂了 :melting_face:

删了重建吧

我上次删了,刚用了一星期,又这样了

是不是不能高强度调用

重新生成下密钥试试呢

Azure AI services - Microsoft Azure

我删了,重新部署吧,非常感谢佬

api key不对

但是前几天用好好的,今天突然不能用了,Cherry Studio也不行

估计超额了吧,我没怎么用,部署了就吃灰了 :bili_038: