Skip to content

[Hearts] Fix certificate send: add required model param to OpenAI image call - #261

Merged
gregv merged 1 commit into
developfrom
bugfix/certificate-image-model
Aug 6, 2026
Merged

[Hearts] Fix certificate send: add required model param to OpenAI image call#261
gregv merged 1 commit into
developfrom
bugfix/certificate-image-model

Conversation

@gregv

@gregv gregv commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Sending a certificate from /admin/certificates failed with Error code: 400 - Missing required parameter: 'model' — OpenAI no longer defaults the model for images.generate
  • Set model="gpt-image-1" (same as common/utils/openai_api.py) with a 90s timeout
  • gpt-image-1 returns base64 instead of a URL, so the background-image save now handles b64_json with a URL fallback for other models

Test plan

  • services.hearts_service imports cleanly under ENVIRONMENT=test
  • Send a certificate from /admin/certificates in prod and confirm no 400

🤖 Generated with Claude Code

…res model

OpenAI removed the default model for images.generate, so sending a
certificate 400'd with "Missing required parameter: 'model'". Use
gpt-image-1 (matching common/utils/openai_api.py) and handle its
base64 response with a URL fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gregv
gregv merged commit 08766ab into develop Aug 6, 2026
6 checks passed
@gregv
gregv deleted the bugfix/certificate-image-model branch August 6, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant