cai icon indicating copy to clipboard operation
cai copied to clipboard

[non-fatal] Tracing client error 403: {"error":{"code":"unsupported_country_region_territory","message":"Country, region, or territory not supported","param":null,"type":"request_forbidden"}}

Open oc4anya opened this issue 3 months ago • 2 comments

Hello, I am a user in Hong Kong. Due to OpenAI's regional restrictions, I cannot access OpenAI. Even if I use DeepSeek LLM, the program still gives me a 403 error. I checked and found that it is because the program accesses the URL https://api.openai.com/v1/traces/ingest. What should I do to use the program normally? my code belike `async def main(): agent = Agent( name="Assistant", instructions="You only respond in haikus.", model=OpenAIChatCompletionsModel( model="deepseek-chat", openai_client=AsyncOpenAI(base_url="https://api.deepseek.com/v1", api_key="sk-1ee7e"), ) )

result = await Runner.run(agent, "Tell me about recursion in programming.",run_config=RunConfig(model_provider=OpenAIProvider(base_url="https://api.deepseek.com/v1", api_key="sk-1ee7eb2c0632")))
print(result.final_output)
# Function calls itself,
# Looping in smaller pieces,
# Endless by design.

if name == "main": asyncio.run(main())`

oc4anya avatar Aug 18 '25 12:08 oc4anya

Hello, I am a user in Hong Kong. Due to OpenAI's regional restrictions, I cannot access OpenAI. Even if I use DeepSeek LLM, the program still gives me a 403 error. I checked and found that it is because the program accesses the URL https://api.openai.com/v1/traces/ingest. What should I do to use the program normally? my code belike `async def main(): agent = Agent( name="Assistant", instructions="You only respond in haikus.", model=OpenAIChatCompletionsModel( model="deepseek-chat", openai_client=AsyncOpenAI(base_url="https://api.deepseek.com/v1", api_key="sk-1ee7e"), ) )

result = await Runner.run(agent, "Tell me about recursion in programming.",run_config=RunConfig(model_provider=OpenAIProvider(base_url="https://api.deepseek.com/v1", api_key="sk-1ee7eb2c0632")))
print(result.final_output)
# Function calls itself,
# Looping in smaller pieces,
# Endless by design.

if name == "main": asyncio.run(main())`

try to use deepseek/deepseek-chat model name

luijait avatar Aug 18 '25 12:08 luijait

Hello @oc4anya wondering if you were able to try what @luijait recommended ? Let us know. Thanks

SoyGema avatar Sep 03 '25 08:09 SoyGema

I have solved this problem. I need to set OLLAMA to true in .env。thanks!

oc4anya avatar Sep 23 '25 11:09 oc4anya