Azure OpenAIで ResponseAPIのCodeInterpreter設定時にエラー

久冨 峻介 25 評価のポイント
2025-10-23T03:53:53.0866667+00:00

Azure OpenAIで ResponseAPIのCodeInterpreter設定時に以下のエラーが出ました。
o3やo4-miniはcode_interpreter対応してないのでしょうか?それともAzure内部の不具合でしょうか?

エラー内容----
The server had an error processing your request. Sorry about that! You can retry your request, or contact us through an Azure support request at: https://go.microsoft.com/fwlink/?linkid=2213926 if you keep seeing this error. (Please include the request ID e2f77899-3b93-43c5-846f-1180b7228e21 in your email


・toolsのCodeInterpreterの指定を無くすと、エラーはでません

・モデルにo3,o4-miniを指定した際も同じようなエラーが出ました。

・o1モデルを指定した際は明確にコードインタプリタに対応していない旨の以下エラーが出ました

(Hosted tool 'code_interpreter' is not supported with o1-2024-12-17)

以下参考コードです

from openai import OpenAI
...
client = OpenAI(
    base_url=f"{AZURE_OPENAI_ENDPOINT}openai/v1/",
    api_key=AZURE_OPENAI_API_KEY,
)
...
response = client.responses.create(
    model="gpt-5",
    input=[{
        "role": "user",
        "content": [
            {"type": "input_text", "text": question}
        ]
    }],
    tools=[
        {"type": "code_interpreter", "container": { "type": "auto" }}
    ]
)
...
Azure OpenAI Service
Azure OpenAI Service
エンタープライズ機能を備えた OpenAI の GPT-3 モデルへのアクセスを提供する Azure サービス。
{count} 件の投票

質問作成者が受け入れた回答
  1. Manas Mohanty 13,340 評価のポイント モデレーター
    2025-10-23T18:34:16.88+00:00

    こんにちは、久富俊介

    O1、O3-miniで『Hosted tool “code_interpreter”はサポートされていません』を再現できました(不一致を報告する必要があります)。 しかし、ドイツ西中央リージョンではo4-miniの結果が表示されています

    
       
    import os
    from openai import OpenAI
    
    client = OpenAI(  
       api_key="<apikey>",
       base_url="https://<openainame>.openai.azure.com//openai/v1/",
    ) 
    
    
    instructions = "You are a personal math tutor. When asked a math question, write and run code using the python tool to answer the question."
    
    response = client.responses.create(
        model="o4-mini",
        tools=[
            {
                "type": "code_interpreter",
                "container": {"type": "auto"}
            }
        ],
    
    
        
        instructions=instructions,
        input="I need to solve the equation 3x + 11 = 14. Can you help me?",
    )
    
    print(response.output)
    
    

    O4-mini/gpt-5 のデプロイメントタイプと、リソースのリージョンを共有してください。 同じ認識を持つためです。

    ありがとうございます。

    0 件のコメント コメントはありません

0 件の追加の回答

並べ替え方法: 最も役に立つ

お客様の回答

質問作成者は回答に "承認済み"、モデレーターは "おすすめ" とマークできます。これにより、ユーザーは作成者の問題が回答によって解決したことを把握できます。