Closed firllyw closed 4 months ago
Before sending POST request, broswer will first send an OPTIONS preflight request to API (e.g. https://api.anthropic.com/v1/messages
). But right now Anthropic API endpoint does not allow OPTIONS method.
Also running into this issue. Anthropic APIs are not callable from the client-side without a proxy server
Also seeing this issue when calling from localhost.
@firllyw + thread: our latest SDK release now offers CORS support [changelog].
Any updates on this? I'm creating an interface but it doesn't work for Anthropic due to this error. https://github.com/EliasPereirah/OrionChat/
Step to Reproduce:
`const anthropic = new Anthropic({ apiKey: process.env.NEXT_PUBLIC_ANTHROPIC_API_KEY, });
function MyDiagrams() { const [loading, setLoading] = useState(false);