"Sorry, something went wrong." When running Thread on Azure OpenAI

Rob 20 Reputation points
2025-07-03T14:37:23.86+00:00

I get this error when trying to create Runs on a Thread

"last_error": {
    "code": "server_error",
    "message": "Sorry, something went wrong."
  },

Here is the full Thread config: (IDs removed)

{
  "id": "",
  "object": "thread.run",
  "created_at": 1751552717,
  "assistant_id": "",
  "thread_id": "",
  "status": "failed",
  "started_at": 1751552718,
  "expires_at": null,
  "cancelled_at": null,
  "failed_at": 1751552718,
  "completed_at": null,
  "required_action": null,
  "last_error": {
    "code": "server_error",
    "message": "Sorry, something went wrong."
  },
  "model": "gpt-4o",
  "instructions": "You are a helpful assistant.",
  "tools": [],
  "tool_resources": {},
  "metadata": {},
  "temperature": 1.0,
  "top_p": 1.0,
  "max_completion_tokens": 100,
  "max_prompt_tokens": null,
  "truncation_strategy": {
    "type": "auto",
    "last_messages": null
  },
  "incomplete_details": null,
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "prompt_token_details": {
      "cached_tokens": 0
    }
  },
  "response_format": "auto",
  "tool_choice": "auto",
  "parallel_tool_calls": true
}

Others seem to have had issues when using tools but you can see here that I've stripped all that out and am still getting the same error. The issue is not intermittent, it happens every time. What else could cause this error?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,118 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerald Felix 2,410 Reputation points
    2025-07-03T15:54:59.35+00:00

    Hello Rob,

    **
    Why your run fails immediately**

    The runtime is telling you only that something in the service pipeline blew up (code:"server_error"). From previous incidents the same symptom is produced by one (or a combination) of the following:

    Likely cause How to confirm Fix / work-around
    Empty thread – you start a run before a user message exists, so the scheduler aborts with 0 prompt tokens (exactly what you see in the object you pasted). Check that usage.prompt_tokens is 0 and your thread has no thread.message resources. Add at least one user message first or use the one-shot threads/runs endpoint and pass the message in the additional_messages array.
    Empty thread – you start a run before a user message exists, so the scheduler aborts with 0 prompt tokens (exactly what you see in the object you pasted). Check that usage.prompt_tokens is 0 and your thread has no thread.message resources. Add at least one user message first or use the one-shot threads/runs endpoint and pass the message in the additional_messages array.
    Missing preview header – every Assistants request still needs OpenAI-Beta: assistants=v2. Forgetting it silently routes to an older backend that throws a 500. Inspect the request you send over the wire. Add the header (see docs & sample calls) ([learn.microsoft.com](https://learn.microsoft.com/en-us/answers/questions/2168565/wheres-the-rest-api-docs-for-the-new-azure-ai-agen?utm_source=chatgpt.com"Where's the REST API docs for the new Azure AI Agents?"))
    Wrong / older API version – Assistants are recognised only from 2024-02-15-preview onward. Look at the api-version= query you pass. Use the current preview (2024-06-01-preview or later) ([learn.microsoft.com](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/assistant?utm_source=chatgpt.com"Getting started with Azure OpenAI Assistants (Preview)"))
    Model build that doesn’t yet support Assistants – early GPT-4o builds in some regions crash the run scheduler. Try the same call with a GPT-4-turbo or GPT-3.5-turbo deployment. If it succeeds, the issue is model-specific. Redeploy GPT-4o with the latest version, or keep using GPT-4-turbo until the backend fix is rolled out ([learn.microsoft.com](https://learn.microsoft.com/en-us/answers/questions/1685523/azure-openai-gpt-4o-issues-in-assistant-api-throw?utm_source=chatgpt.com"Azure OpenAI gpt-4o issues in assistant api, throw an error that this ..."), [learn.microsoft.com](https://learn.microsoft.com/en-us/answers/questions/2287438/azure-openai-assistants-thread-run-failed-generati?utm_source=chatgpt.com"Azure OpenAI Assistants - thread.run.failed generating image with ..."))
    Regional incident / backend bug Send the call again and capture the x-ms-client-request-id header that comes back. Open a support ticket and provide: request-id, run-id, region, model. PG can pull the exact failure trace.

    Quick sanity check

    curl -X POST \
      "$AZURE_OPENAI_ENDPOINT/openai/threads/runs?api-version=2024-06-01-preview" \
      -H "Content-Type: application/json" \
      -H "api-key: $AZURE_OPENAI_KEY" \
      -H "OpenAI-Beta: assistants=v2" \
      -d '{
            "assistant_id": "asst_...your_id...",
            "additional_messages":[
              { "role":"user", "content":"Say hello in one sentence." }
            ]
          }'
    

    If the run now moves to queued or in_progress, the pipeline is healthy and the root cause was an empty thread or missing header.


    If it still fails

    Capture the full response headers (they include request-id and x-ms-region).

    Switch to a different deployment (e.g., GPT-4-turbo) or region to see whether the error is model / region–specific.

    Raise a support ticket with the details above so the product team can look at the backend logs.

    That should get your assistant talking again. Let me know how it goes!

    Best Regards,

    Jerald Felix

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.