Anthropic enables CORS support for Claude API: Anthropic has introduced CORS support for their JSON APIs, allowing developers to make direct calls to Claude language models from client-side applications.
- The new feature was quietly introduced through a pull request in the Anthropic TypeScript SDK, enabling browser-based usage of the API.
- Developers can now add the HTTP request header “anthropic-dangerous-direct-browser-access: true” to enable CORS support for the Anthropic API.
Significance and potential use cases: This update opens up new possibilities for browser-based applications while also presenting potential security considerations.
- The feature is particularly useful for internal tools exposed to trusted users or applications implementing a “bring your own API key” pattern.
- It eliminates the need for server-side proxies, simplifying the architecture of some web applications.
- However, Anthropic had previously been cautious about implementing this feature due to the risk of API key exposure in client-side code.
Practical application example: One developer demonstrated the new functionality through a personal project that leverages the CORS support.
- The developer’s “Haiku” web application, which uses Claude to generate haikus from webcam photos, has been updated to use the new direct API access.
- Previously, the app required a custom proxy to add CORS support, but it can now communicate directly with Anthropic’s API.
AI assistance in implementation: Interestingly, the developer used Claude itself to modify the application code for the new API access.
- Initially, Claude advised against making direct API calls from a browser due to security concerns.
- After the developer explained the new recommendation from Anthropic, Claude proceeded to make the necessary code modifications.
Code snippet for implementation: A simplified JavaScript example illustrates how to use the new CORS support in browser-based applications.
- The code demonstrates how to make a POST request to the Anthropic API using the new header.
- It includes setting the appropriate headers, structuring the request body, and handling the response to display the generated haiku.
Broader implications: This update reflects the evolving landscape of AI API accessibility and integration in web development.
- The move towards allowing direct browser access to AI APIs could lead to more interactive and responsive AI-powered web applications.
- However, it also underscores the ongoing balance between convenience and security in API design, highlighting the need for developers to carefully consider the implications of client-side API access in their applications.
Recent Stories
DOE fusion roadmap targets 2030s commercial deployment as AI drives $9B investment
The Department of Energy has released a new roadmap targeting commercial-scale fusion power deployment by the mid-2030s, though the plan lacks specific funding commitments and relies on scientific breakthroughs that have eluded researchers for decades. The strategy emphasizes public-private partnerships and positions AI as both a research tool and motivation for developing fusion energy to meet data centers' growing electricity demands. The big picture: The DOE's roadmap aims to "deliver the public infrastructure that supports the fusion private sector scale up in the 2030s," but acknowledges it cannot commit to specific funding levels and remains subject to Congressional appropriations. Why...
Oct 17, 2025Tying it all together: Credo’s purple cables power the $4B AI data center boom
Credo, a Silicon Valley semiconductor company specializing in data center cables and chips, has seen its stock price more than double this year to $143.61, following a 245% surge in 2024. The company's signature purple cables, which cost between $300-$500 each, have become essential infrastructure for AI data centers, positioning Credo to capitalize on the trillion-dollar AI infrastructure expansion as hyperscalers like Amazon, Microsoft, and Elon Musk's xAI rapidly build out massive computing facilities. What you should know: Credo's active electrical cables (AECs) are becoming indispensable for connecting the massive GPU clusters required for AI training and inference. The company...
Oct 17, 2025Vatican launches Latin American AI network for human development
The Vatican hosted a two-day conference bringing together 50 global experts to explore how artificial intelligence can advance peace, social justice, and human development. The event launched the Latin American AI Network for Integral Human Development and established principles for ethical AI governance that prioritize human dignity over technological advancement. What you should know: The Pontifical Academy of Social Sciences, the Vatican's research body for social issues, organized the "Digital Rerum Novarum" conference on October 16-17, combining academic research with practical AI applications. Participants included leading experts from MIT, Microsoft, Columbia University, the UN, and major European institutions. The conference...