Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

OpenAI Batch API returns 404 with GPT-5.x models

Fermée
#3,071 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
À clarifier
Activité
Calme
Stack technique
python

Piste de recherche

Commencez par reproduire le problème avec les appels Python indiqués à client.files.create et client.batches.create pour /v1/chat/completions et /v1/responses. Comparez la manière dont la requête batch gère les noms de modèles GPT-5.x par rapport à GPT-4o, et déterminez si la transformation de modèle -batch a lieu dans la bibliothèque ou dans le service. La tâche est terminée lorsque la couche responsable a été identifiée et qu’un batch chat-completions GPT-5.x fonctionnel a été confirmé ou que le upstream fix requis a été documenté.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug upstream
Confirm this is an issue with the Python library and not an underlying OpenAI API
  • This is an issue with the Python library
Describe the bug

/v1/responses API with GPT 5.4 mini or GPT 5.4 nano - works as expected
/v1/chat/completions API with GPT 5.4 mini or GPT 5.4 nano - fails with following error:

{"id": "batch_req_69d553dfec588190b461bf17c6c2602b", "custom_id": "20260318_0", "response": {"status_code": 404, "request_id": "465a86c2-ef40-4dfc-854f-a2f57977fb58", "body": {"error": {"message": "The model `gpt-5-mini-2025-08-07-batch` does not exist or you do not have access to it.", "type": "invalid_request_error", "param": null, "code": "model_not_found"}}}, "error": null}

I confirmed our token do have access to GPT-5-mini model.

I also see as per OpenAI public documentation https://developers.openai.com/api/docs/models/compare GPT-5.1, GPT-5.4-mini and GPT-5.4-nano supports /v1/chat/completions, /v1/responses and /v1/batch APIs but still we are facing issue.

Observations:

This looks like a Open Bug to me - GPT-5.x model is having -batch where as GPT 4.x models are not doing that. However, due to this existing Batch API is failing because the model gpt-5-2025-08-07-batch does not exist!

OpenAI's backend automatically resolves the model to a {model}-batch variant internally and the batch model is not available hence we see model not found 404 error.

Interestedly -batch is not appended when we use /v1/responses with GPT-5.x models

Can you please help to look into this issue further?

To Reproduce

Follow the public OpenAI Batch API documentation with following settings:

1. Use /v1/chat/completions with gpt-5 in jsonl sample: >> Results to 404

Batch Details:

Batch(id='batch_69d63cf462e88190b38365f5d52e432b', completion_window='24h', created_at=1775647988, endpoint='/v1/chat/completions', input_file_id='file-DcVD2SZBnBbM1qFLjJdFnq', object='batch', status='completed', cancelled_at=None, cancelling_at=None, completed_at=1775648130, error_file_id='file-YEubDCUtGwo1aXqQ5zE1EK', errors=None, expired_at=None, expires_at=1775734388, failed_at=None, finalizing_at=1775648128, in_progress_at=1775648050, metadata={'description': 'nightly eval job'}, model='gpt-5-2025-08-07', output_file_id=None, request_counts=BatchRequestCounts(completed=0, failed=2, total=2), usage=BatchUsage(input_tokens=0, input_tokens_details=InputTokensDetails(cached_tokens=0), output_tokens=0, output_tokens_details=OutputTokensDetails(reasoning_tokens=0), total_tokens=0))

Batch errors:

{"id": "batch_req_69d63d81f74c8190be387e6c8a69a94d", "custom_id": "20260318_0", "response": {"status_code": 404, "request_id": "9407df48-bc25-4091-85b1-db2af30c14cb", "body": {"error": {"message": "The model `gpt-5-2025-08-07-batch` does not exist or you do not have access to it.", "type": "invalid_request_error", "param": null, "code": "model_not_found"}}}, "error": null}
{"id": "batch_req_69d63d81f3788190b84d4e9d31c98ea5", "custom_id": "20260318_1", "response": {"status_code": 404, "request_id": "3b813cf8-9d80-4163-aaac-02054549f62e", "body": {"error": {"message": "The model `gpt-5-2025-08-07-batch` does not exist or you do not have access to it.", "type": "invalid_request_error", "param": null, "code": "model_not_found"}}}, "error": null}

2. Use /v1/chat/completions with GPT-4o >> Results to 200

Batch Details:

Batch(id='batch_69d63eb8f8d48190a308eaff77d87d4f', completion_window='24h', created_at=1775648440, endpoint='/v1/chat/completions', input_file_id='file-B75LM1cgyUbGcqui7xwEEz', object='batch', status='completed', cancelled_at=None, cancelling_at=None, completed_at=1775648570, error_file_id=None, errors=None, expired_at=None, expires_at=1775734840, failed_at=None, finalizing_at=1775648569, in_progress_at=1775648502, metadata={'description': 'nightly eval job'}, model='gpt-4o-2024-08-06', output_file_id='file-63VdpMgDEiTFEL5TPx2Hoe', request_counts=BatchRequestCounts(completed=2, failed=0, total=2), usage=BatchUsage(input_tokens=208, input_tokens_details=InputTokensDetails(cached_tokens=0), output_tokens=2, output_tokens_details=OutputTokensDetails(reasoning_tokens=0), total_tokens=210))
{"id": "batch_req_69d63f3a09d08190ad8763cec4122455", "custom_id": "20260318_0", "response": {"status_code": 200, "request_id": "8bad7825-fc45-4eb4-a5e5-fe8d6ac6cbd7", "body": {"id": "chatcmpl-DSLZymKB4dL7HY3ifyItvRelUV7v3", "object": "chat.completion", "created": 1775648506, "model": "gpt-4o-2024-08-06", "choices": [{"index": 0, "message": {"role": "assistant", "content": "No", "refusal": null, "annotations": []}, "logprobs": {"content": [{"token": "No", "logprob": -0.001268089865334332, "bytes": [78, 111], "top_logprobs": [{"token": "No", "logprob": -0.001268089865334332, "bytes": [78, 111]}, {"token": "Yes", "logprob": -6.673142910003662, "bytes": [89, 101, 115]}]}], "refusal": null}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 84, "completion_tokens": 1, "total_tokens": 85, "prompt_tokens_details": {"cached_tokens": 0, "audio_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 0, "audio_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0}}, "service_tier": "default", "system_fingerprint": "fp_b07aafcada"}}, "error": null}
{"id": "batch_req_69d63f3a05d881909a3dedc84fb8fbb0", "custom_id": "20260318_1", "response": {"status_code": 200, "request_id": "4ef6e663-28a4-4822-8ad6-d6f2a91ff833", "body": {"id": "chatcmpl-DSLaxjh7pFB08FahxYbflpj4eDebx", "object": "chat.completion", "created": 1775648567, "model": "gpt-4o-2024-08-06", "choices": [{"index": 0, "message": {"role": "assistant", "content": "No", "refusal": null, "annotations": []}, "logprobs": {"content": [{"token": "No", "logprob": -0.008623439818620682, "bytes": [78, 111], "top_logprobs": [{"token": "No", "logprob": -0.008623439818620682, "bytes": [78, 111]}, {"token": "Yes", "logprob": -4.7586236000061035, "bytes": [89, 101, 115]}]}], "refusal": null}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 124, "completion_tokens": 1, "total_tokens": 125, "prompt_tokens_details": {"cached_tokens": 0, "audio_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 0, "audio_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0}}, "service_tier": "default", "system_fingerprint": "fp_4d38c3c00d"}}, "error": null}

3. Use /v1/responses with gpt-5.1 in jsonl sample: >> Results to 200

{"id": "batch_req_69d54dfc41748190905c15b13af35002", "custom_id": "20260318_0", "response": {"status_code": 200, "request_id": "9a3e55ba-f770-4c4f-890a-6c90fc93cb2b", "body": {"id": "resp_059ba18e9e3f57c80069d54df03d9081968de7d01ad772ba2c", "object": "response", "created_at": 1775586800, "status": "completed", "background": false, "billing": {"payer": "developer"}, "completed_at": 1775586800, "error": null, "frequency_penalty": 0.0, "incomplete_details": null, "instructions": null, "max_output_tokens": null, "max_tool_calls": null, "model": "gpt-5.4-nano-2026-03-17", "output": [{"id": "msg_059ba18e9e3f57c80069d54df060788196b87e157e1eb5acdd", "type": "message", "status": "completed", "content": [{"type": "output_text", "annotations": [], "logprobs": [], "text": "Yes."}], "phase": "final_answer", "role": "assistant"}], "parallel_tool_calls": true, "presence_penalty": 0.0, "previous_response_id": null, "prompt_cache_key": null, "prompt_cache_retention": null, "reasoning": {"effort": "none", "summary": null}, "safety_identifier": null, "service_tier": "default", "store": true, "temperature": 1.0, "text": {"format": {"type": "text"}, "verbosity": "medium"}, "tool_choice": "auto", "tools": [], "top_logprobs": 0, "top_p": 0.98, "truncation": "disabled", "usage": {"input_tokens": 58, "input_tokens_details": {"cached_tokens": 0}, "output_tokens": 6, "output_tokens_details": {"reasoning_tokens": 0}, "total_tokens": 64}, "user": null, "metadata": {}}}, "error": null}
Code snippets

/v1/chat/completions -

batch_json_test-chat.jsonl

{"custom_id": "20260318_0", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gpt-4o", "messages": [{"role": "system", "content": "Answer the question using following rule:1) The brand is a retail brand if it sells own product.2) A retail brand or chain is a store that sells other products.3) Generate output response in Yes/NoDo not give reasoning in response."},{"role": "user", "content": "Question: Does this Brand: lucky nurse st patrick's day nursing gnome outfit has a retail chain"}],"max_completion_tokens": 250, "logprobs": true, "top_logprobs": 2, "temperature": 0}}
{"custom_id": "20260318_1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gpt-4o", "messages": [{"role": "system", "content": "Answer the question using following rule:1) The brand is a retail brand if it sells own product.2) A retail brand or chain is a store that sells other products.3) Generate output response in Yes/NoDo not give reasoning in response."},{"role": "user", "content": "Question: Does this Brand: infantino oxo tot ezpz aeiou aeiou aeiou dr. brown's ubbi philips avent the first years the first years lalo nuk lalo mam infantino infantino infantino infantino infantino infantino infantino infantino has a retail chain"}],"max_completion_tokens": 250, "logprobs": true, "top_logprobs": 2, "temperature": 0}}
batch_input_file = client.files.create(
    file=open("batch_json_test-chat.jsonl", "rb"),
    purpose="batch"
)

create_batch = client.batches.create(
    input_file_id=batch_input_file_id,
    endpoint="/v1/chat/completions",
    completion_window="24h",
    metadata={
        "description": "nightly eval job"
    }
)
print(f"Batch created: {create_batch.id} | status: {create_batch.status}")

while True:
    batch = client.batches.retrieve(create_batch.id)
    print(f"batch: \n{batch}")
    print(f"Status: {batch.status} | "
          f"completed: {batch.request_counts.completed}/"
          f"{batch.request_counts.total}")

    if batch.status in ("completed", "failed", "expired", "cancelled"):
        break
    time.sleep(30)

/v1/responses -

batch_json_test-responses.jsonl

{"custom_id": "20260318_0", "method": "POST", "url": "/v1/responses", "body": {"model": "gpt-5.4-nano", "input": "Answer the question using following rule:1) The brand is a retail brand if it sells own product.2) A retail brand or chain is a store that sells other products.3) Generate output response in Yes/NoDo not give reasoning in response."}}
{"custom_id": "20260318_1", "method": "POST", "url": "/v1/responses", "body": {"model": "gpt-5.4-nano", "input": "Answer the question using following rule:1) The brand is a retail brand if it sells own product.2) A retail brand or chain is a store that sells other products.3) Generate output response in Yes/NoDo not give reasoning in response."}}
batch_input_file = client.files.create(
    file=open("batch_json_test-responses.jsonl", "rb"),
    purpose="batch"
)

create_batch = client.batches.create(
    input_file_id=batch_input_file_id,
    endpoint="/v1/responses",
    completion_window="24h",
    metadata={
        "description": "nightly eval job"
    }
)
print(f"Batch created: {create_batch.id} | status: {create_batch.status}")

while True:
    batch = client.batches.retrieve(create_batch.id)
    print(f"batch: \n{batch}")
    print(f"Status: {batch.status} | "
          f"completed: {batch.request_counts.completed}/"
          f"{batch.request_counts.total}")

    if batch.status in ("completed", "failed", "expired", "cancelled"):
        break
    time.sleep(30)
OS

macOS

Python version

Python v3.13.5

Library version

openai v2.21.0

Langage dominant
Python
Étoiles
31.9k
Forks
8k
Merge moyen
11 h 44 min
PR mergées (30 j)
166

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de openai/openai-python

Toutes les issues de openai/openai-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.