SShortSingh.
Back to feed

Claude API Drops JSON Prefill Support; Developers Must Switch to Structured Outputs or Tool Use

0
·2 views

Anthropic's Claude models from Opus 4.6 onward no longer support last-assistant-turn prefilling, a common technique developers used to force JSON output, now returning a 400 error. The recommended replacement for enforcing a JSON schema is the output_config.format parameter, which validates responses against a defined schema automatically and integrates with Zod for type safety in TypeScript. Alternatively, developers can use tool use with strict mode enabled when the structured data represents arguments for an action rather than a direct answer. The key distinction is whether JSON is the final output to be consumed directly, favoring structured outputs, or an intermediate step passed to another operation, favoring tool use. Developers who have not yet updated their code risk breakage as soon as they upgrade their model version string.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Dev builds zero-signup demo system that auto-provisions and deletes throwaway tenants

A developer behind NeNe Invoice, an open-source self-hosted invoicing app for Japanese small businesses, built a demo system that requires no account creation. Clicking a demo URL instantly provisions a unique disposable tenant pre-loaded with realistic industry-specific data, then automatically deletes it three hours later via a cron job. The system leverages the app's existing multi-tenancy architecture, requiring roughly 900 lines of new code with no changes to the core authentication logic. Demo tenants are prefixed with 'demo-' to namespace them and safely identify them for cleanup, ensuring real organizations are never affected. Seeded data uses dates relative to the current day so the demo always appears current, and the feature is hidden behind a server-side flag that returns a 404 on non-demo instances.

0
ProgrammingDEV Community ·

Chrome Extension Fixes UI Annoyances in Xperience by Kentico Admin Panel

A developer has released Xperience Community: Admin Styles, a free Chrome extension designed to improve the visual experience of the Xperience by Kentico admin interface. The extension addresses recurring UI friction points including oversized scrollbars, inaccessible tab panels on smaller browser windows, and blank placeholder columns wasting screen space. It works purely by injecting CSS and does not collect or transmit any user data, with its source code publicly available for review. The extension is available via the Chrome Web Store and is compatible with all Chromium-based browsers, including Edge and Brave, activating automatically on any admin URL without requiring configuration. The project is open to contributions and is intended to grow over time as additional quality-of-life improvements are identified.

0
ProgrammingDEV Community ·

How to Fetch API Data in React Using useEffect, useState, and Async/Await

A tutorial on DEV Community walks beginners through fetching external API data inside React components using the FakeStoreAPI as a practical example. The guide first explains how JavaScript's native fetch() works with .then() promise chains, then shows how async/await simplifies the same logic with cleaner, more readable syntax. It demonstrates the correct React pattern of placing fetch calls inside the useEffect hook combined with useState to store results, avoiding infinite render loops. The tutorial also covers managing loading and error states to build a more resilient user interface. A common beginner mistake — marking the useEffect callback itself as async — is highlighted and explained, with the recommended fix of defining a separate async function inside the hook.