helicone icon indicating copy to clipboard operation
helicone copied to clipboard

Anthropic Stream Issue

Open samtamp95 opened this issue 1 year ago • 2 comments

Path: /getting-started/integration-method/anthropic

Is there not away to enable anthropic so that it streams?

I tried using openai's but anthropic isn't really compatible with it.

any suggestions on the best to use anthropic and helicone but stream the text?

samtamp95 avatar Apr 06 '24 10:04 samtamp95

Hi, we do support streaming for anthropic. Here is an example curl:

curl --request -N POST \
  --url https://anthropic.hconeai.com/v1/messages \
  --header 'Content-Type: application/json' \
  --header 'Helicone-Auth: Bearer {HELICONE_API_KEY}' \
  --header 'anthropic-version: 2023-06-01' \
  --header 'x-api-key: {ANTHROPIC_API_KEY}' \
  --data '{
	"model": "claude-3-opus-20240229",
	"max_tokens": 100,
	"stream": true,
	"messages": [
		{
			"role": "user",
			"content": [
				{
					"type": "text",
					"text": "Tell me a story"
				}
			]
		}
	]
}'

colegottdank avatar Apr 11 '24 20:04 colegottdank

same issue here

aoganesyan avatar Sep 09 '24 06:09 aoganesyan

Closing, since @colegottdank 's solution is the way to do it :D

connortbot avatar Jul 15 '25 18:07 connortbot