https://www.boundaryml.com logo
v
Hi Team I am impressed by the BAML and started using on produciton I have to move to GPT 5 however getting following error
Copy code
Request failed with status code: 404 Not Found. {"error":{"code":404,"message":"models/gpt-5 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.","status":"NOT_FOUND"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 404 Not Found. {"error":{"code":404,"message":"models/gpt-5 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.","status":"NOT_FOUND"}}
Copy code
client<llm> CustomGPT5 {
  provider openai
  options {
    model "gpt-5"
    api_key env.OPENAI_API_KEY
  }
}
Please help me with the right way to use GPT5 thanks
a
Try using the provider “openai-responses”
If it still fails due to bad request it s because we have a bug and we will patch it tomorrow PSY
Pst
In about 12 hrs
v
on it, checking
Copy code
cvly_backend  |     ---REQUEST OPTIONS---
cvly_backend  |     ---ERROR (Unspecified error code: 404)---
cvly_backend  |     Request failed with status code: 404 Not Found. {"error":{"code":404,"message":"models/gpt-5-mini is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.","status":"NOT_FOUND"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 404 Not Found. {"error":{"code":404,"message":"models/gpt-5-mini is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.","status":"NOT_FOUND"}}
@aaronv (BAML)
Copy code
cvly_backend  |     [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 404 Not Found. {"error":{"code":404,"message":"models/gpt-4 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.","status":"NOT_FOUND"}}
cvly_backend  | [Error] POST /api/ai/chat -> 503: Our AI is a bit busy right now. Please try again in a few seconds.
cvly_backend  | [req] 503 POST /api/ai/chat 5536ms origin=http://localhost:3000 referer=http://localhost:3000
weird that chat gpt 4 is also not workung.,.. 🙁
b
AYU Light theme is insane nostalgia This is my gpt5 config
Copy code
baml
client<llm> GPT5_Nano_Fast {
  provider openai
  options {
    model "gpt-5-nano"
    api_key env.OPENAI_API_KEY
    verbosity "low" // "low" | "medium" | "high"
    reasoning_effort "medium" // "low" | "medium" | "high"
  }
}

client<llm> GPT5_Nano_DumbFast {
  provider openai
  options {
    model "gpt-5-nano"
    api_key env.OPENAI_API_KEY
    verbosity "low" // "low" | "medium" | "high"
    reasoning_effort "low" // "low" | "medium" | "high"
  }
}

client<llm> GPT5_Nano_SmartFast {
  provider openai
  options {
    model "gpt-5-nano"
    api_key env.OPENAI_API_KEY
    verbosity "low" // "low" | "medium" | "high"
    reasoning_effort "high" // "low" | "medium" | "high"
  }
}

client<llm> GPT5_Nano_SmartReasoner {
  provider openai
  options {
    model "gpt-5-nano"
    api_key env.OPENAI_API_KEY
    verbosity "high" // "low" | "medium" | "high"
    reasoning_effort "high" // "low" | "medium" | "high"
  }
}

client<llm> GPT5_SmartFast {
  provider openai
  options {
    model "gpt-5-nano"
    api_key env.OPENAI_API_KEY
    verbosity "low" // "low" | "medium" | "high"
    reasoning_effort "high" // "low" | "medium" | "high"
  }
}
reasoning effort is an object, not a flat key for the responeses api
same with verbosity, its an object within
text
hope this helps!
b
Nice! Old Completions API + new Responses API method
v
Copy code
client<llm> GPT5_Nano_Fast {
  provider openai-responses
  options {
    model "gpt-5-nano"
    api_key env.OPENAI_API_KEY
    text { verbosity "low" } // "low" | "medium" | "high"
    reasoning { effort "low" } // "low" | "medium" | "high"
  }
}
yep!
v
thanks @Vaibhav (BAML 🐑) working
Copy code
client<llm> GPT5_Nano_Fast {
  provider openai-responses
  options {
    model "gpt-5-nano"
    api_key env.OPENAI_API_KEY
    text { verbosity "low" } // "low" | "medium" | "high"
    reasoning { effort "low" } // "low" | "medium" | "high"
  }
}

client<llm> GPT5_MINI_MEDIUM {
  provider openai-responses
  options {
    model "gpt-5-mini"
    api_key env.OPENAI_API_KEY
    text { verbosity "medium" } // "low" | "medium" | "high"
    reasoning { effort "medium" } // "low" | "medium" | "high"
  }
}

client<llm> GPT5_MEDIUM {
  provider openai-responses
  options {
    model "gpt-5"
    api_key env.OPENAI_API_KEY
    text { verbosity "medium" } // "low" | "medium" | "high"
    reasoning { effort "medium" } // "low" | "medium" | "high"
  }
}
thanks @broken💎shaders @aaronv (BAML) @Vaibhav (BAML 🐑) looks like all good for me to take gpt 5 to prod
I am back 😄 If i am using
provider openai
instead of
provider openai-responses
then I am getting following error
Copy code
Request failed with status code: 400 Bad Request. {"error":{"message":"Unknown parameter: 'text'.","type":"invalid_request_error","param":"text","code":"unknown_parameter"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 400 Bad Request. {"error":{"message":"Unknown parameter: 'text'.","type":"invalid_request_error","param":"text","code":"unknown_parameter"}
also if i use
provider openai-responses
then pdf and images attachments are not working with GPT however same code is working seemlessly with vertex ai
Copy code
cvly_backend  |     ---REQUEST OPTIONS---
cvly_backend  |     model: "gpt-5-mini"
cvly_backend  |     text: {"verbosity":"medium"}
cvly_backend  |     reasoning: {"effort":"medium"}
cvly_backend  |     ---ERROR (Unspecified error code: 400)---
cvly_backend  |     Request failed with status code: 400 Bad Request. {"error":{"message":"Invalid value: 'input_image'. Supported values are: 'input_text'.","type":"invalid_request_error","param":"input[0].content[1]","code":"invalid_value"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 400 Bad Request. {"error":{"message":"Invalid value: 'input_image'. Supported values are: 'input_text'.","type":"invalid_request_error","param":"input[0].content[1]","code":"invalid_value"}}
a
that is due to a bug
let me patch it today
v
thanks @aaronv (BAML) , looking forward to it desperately
a
@vikasbansal_73336 try using 0.207.1!
v
ugraded to 0.207.1 then tried with using
openai
provider, i am getting following error
Copy code
cvly_backend  |     ---REQUEST OPTIONS---
cvly_backend  |     model: "gpt-5-mini"
cvly_backend  |     text: {"verbosity":"medium"}
cvly_backend  |     reasoning: {"effort":"medium"}
cvly_backend  |     ---ERROR (Unspecified error code: 400)---
cvly_backend  |     Request failed with status code: 400 Bad Request. {"error":{"message":"Unknown parameter: 'text'.","type":"invalid_request_error","param":"text","code":"unknown_parameter"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 400 Bad Request. {"error":{"message":"Unknown parameter: 'text'.","type":"invalid_request_error","param":"text","code":"unknown_parameter"}}
using
openai-response
Copy code
cvly_backend  |     ---REQUEST OPTIONS---
cvly_backend  |     model: "gpt-5-mini"
cvly_backend  |     text: {"verbosity":"medium"}
cvly_backend  |     reasoning: {"effort":"medium"}
cvly_backend  |     ---ERROR (Unspecified error code: 400)---
cvly_backend  |     Request failed with status code: 400 Bad Request. {"error":{"message":"Invalid value: 'input_file'. Supported values are: 'input_text'.","type":"invalid_request_error","param":"input[0].content[1]","code":"invalid_value"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 400 Bad Request. {"error":{"message":"Invalid value: 'input_file'. Supported values are: 'input_text'.","type":"invalid_request_error","param":"input[0].content[1]","code":"invalid_value"}}
same code working with vertex ai
even a simple message is not working with openai provider (working with openai-response though)
Copy code
cvly_backend  |     ---REQUEST OPTIONS---
cvly_backend  |     model: "gpt-5-mini"
cvly_backend  |     text: {"verbosity":"medium"}
cvly_backend  |     reasoning: {"effort":"medium"}
cvly_backend  |     ---ERROR (Unspecified error code: 400)---
cvly_backend  |     Request failed with status code: 400 Bad Request. {"error":{"message":"Unknown parameter: 'text'.","type":"invalid_request_error","param":"text","code":"unknown_parameter"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 400 Bad Request. {"error":{"message":"Unknown parameter: 'text'.","type":"invalid_request_error","param":"text","code":"unknown_parameter"}}
v
Does the raw curl look right?
v
how should I get it for you? @Vaibhav (BAML 🐑) feeling too dumb to ask this
a
The playground has a tab called curl
v
checking
i can jump over a zoom if you are available and you think it will be quick
i am still in the process of learning baml
Copy code
curl -X POST 'https://api.openai.com/v1/responses' -H "authorization: Bearer $OPENAI_API_KEY" -H "content-type: application/json" -d "{
  \"model\": \"gpt-5-mini\",
  \"text\": {
    \"verbosity\": \"medium\"
  },
  \"reasoning\": {
    \"effort\": \"medium\"
  },
  \"input\": [
    {
      \"role\": \"system\",
      \"content\": [
        {
          \"type\": \"input_text\",
          \"text\": \"...\"
        }
      ]
    },
    {
      \"role\": \"user\",
      \"content\": [
        {
          \"type\": \"input_text\",
          \"text\": \"..."
        }
      ]
    }
  ]
}"
a
This works, ty 🙂
Can you also paste your client definition?
It deosnt like the “text.verbosity” stuff
v
Copy code
client<llm> GPT5_MINI_MEDIUM {
  provider openai-responses
  options {
    model "gpt-5-mini"
    api_key env.OPENAI_API_KEY
    text { verbosity "medium" } // "low" | "medium" | "high"
    reasoning { effort "medium" } // "low" | "medium" | "high"
  }
}
a
Can you try deleting that key?
Or comment it out
v
Copy code
client<llm> GPT5_MINI_MEDIUM {
  provider openai-responses
  options {
    model "gpt-5-mini"
    api_key env.OPENAI_API_KEY
    // text { verbosity "medium" } // "low" | "medium" | "high"
    reasoning { effort "medium" } // "low" | "medium" | "high"
  }
}
testing would take 3-4 mins, hold
Copy code
cvly_backend  |     ---REQUEST OPTIONS---
cvly_backend  |     model: "gpt-5-mini"
cvly_backend  |     reasoning: {"effort":"medium"}
cvly_backend  |     ---ERROR (Unspecified error code: 400)---
cvly_backend  |     Request failed with status code: 400 Bad Request. {"error":{"message":"Invalid value: 'input_file'. Supported values are: 'input_text'.","type":"invalid_request_error","param":"input[0].content[1]","code":"invalid_value"}}
cvly_backend  | [debug] [chat] llm error BamlClientHttpError BamlError: BamlClientError: BamlClientHttpError: Request failed with status code: 400 Bad Request. {"error":{"message":"Invalid value: 'input_file'. Supported values are: 'input_text'.","type":"invalid_request_error","param":"input[0].content[1]","code":"invalid_value"}}
same error
a
Ok one sec ill setup a zoom
v
joining
Copy code
curl -X POST 'https://api.openai.com/v1/responses' -H "authorization: Bearer $OPENAI_API_KEY" -H "content-type: application/json" -d "{
  \"model\": \"gpt-4o\",
  \"text\": {
    \"verbosity\": \"medium\"
  },
  \"input\": [
    {
      \"role\": \"system\",
      \"content\": [
        {
          \"type\": \"input_text\",
          \"text\": \""
        },
        {
          \"type\": \"input_file\",
          \"file_url\": \""
        }
      ]
    },
    {
      \"role\": \"user\",
      \"content\": [
        {
          \"type\": \"input_text\",
          \"text\": \""
        }
      ]
    }
  ]
}"
a
file_url was also base64 string.
v
is this fixed? @aaronv (BAML) can i use gpt4o with file upload?
a
you can do it with the
openai
provider, but not
openai-responses
. I will be releasing a patch tomorrow
v
Hi @aaronv (BAML) @Vaibhav (BAML 🐑) @broken💎shaders I am sorry to bother you again.. however I am just not able to get GPT 5 work with PDF and Images using BAML I am attaching a PoC for you to reproduce the error (download the zip)
Copy code
# Install client dependencies
cd client && npm install
   
# Install server dependencies
cd ../server && npm install
- Error - Calling
AnalyzeAttachments
with a PDF returns 400 from OpenAI:
Copy code
{
  "error": {
    "message": "Invalid value: 'input_file'. Supported values are: 'input_text'.",
    "type": "invalid_request_error",
    "param": "input[0].content[1]",
    "code": "invalid_value"
  }
}
- Config: - Client:
ChatGPT
- Model:
"gpt-5"
- Stack ends at
server/baml_client/baml_client/async_client.ts:135
- Thrown as
BamlClientHttpError
- How I process PDFs - Endpoint:
POST /api/chat
-
multer
memory storage; accept
message
and
files[]
(PDFs/images) - PDFs: convert to base64 data URL and create BAML `Pdf`:
Copy code
ts
    const b64 = `data:application/pdf;base64,${f.buffer.toString("base64")}`;
    const pdf = Pdf.fromBase64(b64);
    pdfs.push(pdf);
- Images:
Image.fromBase64(mimeType, base64)
- Call:
Copy code
ts
    await b.AnalyzeAttachments(message, pdfs.length ? pdfs : undefined, images.length ? images : undefined)
https://cdn.discordapp.com/attachments/1416329667001978942/1419234020364914688/image.png?ex=68d1042e&is=68cfb2ae&hm=34d00ed19677e09fb1adaa2451822a3f1a8345bebae66ea21d966f54334b9f42& https://cdn.discordapp.com/attachments/1416329667001978942/1419234020591669318/poc.zip?ex=68d1042e&is=68cfb2ae&hm=d0045c4832336f6705be1a0d577e5efcb36366dfef84d5ca7647d3da01e85ab7&
a
You use openai-responses right?
v
i tired with both openai-response and openai ... could not get it working so I cerated PoC (attached ⬆︎)
a
Can you try 0.208.0?
We just released it
Both the extension, and your local baml dependency
Generator config must also say 0.208.0
v
on it
a
Oh you cant put attachments in the system message
They need to go on the user message
v
Could you please provide a documentation link that clarifies what you mean by this? @arafat_38508
I can follow that and update the Po
a
Awesome 🙂
2 Views