bytedance/UI-TARS-desktop
View on GitHub[Bug Report]: OpenAI Provider Returns 404 Error While Direct API Calls Work Fine
Open
#858 opened on Jul 2, 2025
Agent TARSBugGood first issue
Repository metrics
- Stars
- (36,199 stars)
- PR merge metrics
- (PR metrics pending)
Description
Version
agent-tars/0.2.7 darwin-arm64 node-v22.17.0
Issue Type
- Select a issue type 👇
- Agent TARS Web UI (
@agent-tars/web-ui) - Agent TARS CLI (
@agent-tars/server) - Agent TARS Server (
@agent-tars/server) - Agent TARS (
@agent-tars/core) - MCP Agent (
@mcp-agent/core) - Agent Kernel (
@multimodal/agent) - Other (please specify in description)
Model Provider
- Select a model provider 👇
- Volcengine
- Anthropic
- OpenAI
- Azure OpenAI
- Other (please specify in description)
Problem Description
Bug Description
Agent TARS consistently returns "404 Resource not found" error when using the OpenAI provider, despite direct OpenAI API calls working correctly with the same API key and network configuration.
Environment
- Network: China mainland with proxy configuration
- Proxy: 127.0.0.1:4780
Problem Summary
❌ OpenAI Provider (FAILS)
- Provider:
openai - Model:
gpt-4o - API Key: Valid (verified with curl)
- Error:
404 Resource not found - Occurs in: Both CLI and Web UI
✅ Direct OpenAI API Call (WORKS)
curl -x http://127.0.0.1:4780 https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY"
# Returns normal model list successfully
Reproduction Steps
Command Line
agent-tars run \
--input "Find information about UI TARS" \
--model.provider openai \
--model.id gpt-4o \
--model.apiKey {my-api-key} \
--format json
Result:
{
"sessionId": "3zvvbfEkWEIYgS2Iz19Nm",
"result": {
"id": "3526d2b3-bcde-40a2-beb0-9abb1bb6b322",
"type": "assistant_message",
"timestamp": 1751442535990,
"content": "Sorry, an error occurred while processing your request: Error: 404 Resource not found",
"finishReason": "error"
}
Web UI
agent-tars \
--provider openai \
--model gpt-4o \
--apiKey {my-api-key}
Result: Same "404 Resource not found" error in web interface.
Evidence That API Key and Network Are Valid
Direct API Verification
# Test 1: List models
curl -x http://127.0.0.1:4780 https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY"
# ✅ SUCCESS: Returns complete model list
# Test 2: Chat completion
curl -x http://127.0.0.1:4780 https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hi"}],"max_tokens":1}'
# ✅ SUCCESS: Returns valid response
Both direct API calls work perfectly with the same API key and proxy configuration.
Configuration Attempted
// agent-tars.config.ts
import { defineConfig } from '@agent-tars/interface';
export default defineConfig({
model: {
provider: 'openai',
id: 'gpt-4o',
apiKey: process.env.OPENAI_API_KEY,
},
browser: {
control: 'dom',
},
});
Comparison with Other Providers
- Doubao (volcengine): ✅ Works perfectly in Agent TARS
- OpenAI: ❌ 404 error in Agent TARS, ✅ works with direct API calls
I'm wondering if this issue is related to my local environment, or Agent TARS itself. Thank you!