eca icon indicating copy to clipboard operation
eca copied to clipboard

imagegen deployment must be provided through header: x-ms-oai-image-generation-deployment

Open drcxd opened this issue 2 months ago • 1 comments

Describe the bug

I was trying gpt-6-astra with our customized provider, and sending a simple text prompt requesting the agent read the content of a file results in a 400 error response:

OpenAI response status: 400 body: data: {"error": {"message": "{\n  \"error\": {\n    \"message\": \"imagegen deployment must be provided through header: x-ms-oai-image-generation-deployment\",\n    \"type\": \"image_generation_user_error\",\n    \"param\": \"tools\",\n    \"code\": \"invalid_request_error\"\n  }\n}", "type": "None", "param": "None", "code": "400"}}

To Reproduce

Can't reproduce without the customized provider...

Expected behavior

The model should be able to respond without error. Doctor

ECA version: 0.160.3

Server cmd: 

Workspaces: C:\Users\Administrator\.config\eca

Default model: deepseek/deepseek-flash (API key (sk-**********033))

Logged providers: None
Relevant env vars: 
MICROSOFT_WINDOWSAPPRUNTIME_BASE_DIRECTORY=C:\Program Files\WindowsApps\Microsoft.CommandPalette_0.11.11762.0_x64__8wekyb3d8bbwe\


Credential files: None found

Additional context

Debug log:

07:30:06.729 WARN  chat=c2a70994-220c-4114-b2e0-dfea0fe4598b [OPENAI] Unexpected response status: %s body: %s 400 data: {"error": {"message": "{\n  \"error\": {\n    \"message\": \"imagegen deployment must be provided through header: x-ms-oai-image-generation-deployment\",\n    \"type\": \"image_generation_user_error\",\n    \"param\": \"tools\",\n    \"code\": \"invalid_request_error\"\n  }\n}", "type": "None", "param": "None", "code": "400"}}


07:30:06.729 ERROR chat=c2a70994-220c-4114-b2e0-dfea0fe4598b {:message "OpenAI response status: 400 body: data: {\"error\": {\"message\": \"{\\n  \\\"error\\\": {\\n    \\\"message\\\": \\\"imagegen deployment must be provided through header: x-ms-oai-image-generation-deployment\\\",\\n    \\\"type\\\": \\\"image_generation_user_error\\\",\\n    \\\"param\\\": \\\"tools\\\",\\n    \\\"code\\\": \\\"invalid_request_error\\\"\\n  }\\n}\", \"type\": \"None\", \"param\": \"None\", \"code\": \"400\"}}\n\n", :status 400, :body "data: {\"error\": {\"message\": \"{\\n  \\\"error\\\": {\\n    \\\"message\\\": \\\"imagegen deployment must be provided through header: x-ms-oai-image-generation-deployment\\\",\\n    \\\"type\\\": \\\"image_generation_user_error\\\",\\n    \\\"param\\\": \\\"tools\\\",\\n    \\\"code\\\": \\\"invalid_request_error\\\"\\n  }\\n}\", \"type\": \"None\", \"param\": \"None\", \"code\": \"400\"}}\n\n", :headers {"x-litellm-key-spend" "0.011020000000000002", "x-litellm-response-cost-discount-amount" "0.0", "content-type" "text/event-stream; charset=utf-8", "x-litellm-version" "1.80.5", "x-litellm-response-cost-original" "0.0", "x-litellm-call-id" "3afa4855ce00e89b874cbf58030a31e8", ":status" "400", "date" "Fri, 18 Sep 2026 07:30:04 GMT", "x-litellm-key-max-budget" "100.0"}}

Customized provider config:

    "providers": {
        "custom": {
            "api": "openai-responses",
            "url": "https://api.ai.xyz.net",
            "key": "-----------"
        }
    },

drcxd avatar Sep 18 '26 07:09 drcxd

@drcxd you can pass custom headers to a model via extraHeaders config, check it out: https://eca.dev/config/models/#custom-model-settings--payload--header

ericdallo avatar Oct 05 '26 19:10 ericdallo