Skip to main content
POST
/
v2
/
studio
/
deployment
/
prompt
/
stream
Prompt a deployment with streaming response
curl --request POST \
  --url https://api.neynar.com/v2/studio/deployment/prompt/stream \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "prompt": "<string>",
  "deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "fid": 3,
  "name": "<string>",
  "namespace": "<string>",
  "conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "session_id": "<string>",
  "system_prompt_variant": "canary"
}
'
{
  "error": "<string>"
}
The Miniapp Studio API is an allowlisted API and not publicly available. Contact the Neynar team for more information.

Streaming Response Types

This endpoint uses Server-Sent Events (SSE) for streaming responses, which is why the OpenAPI specification only shows an empty 200 response. The actual streaming response returns the following message types (all exported by @anthropic-ai/claude-code except ErrorMessage):
  • SDKAssistantMessage: Claude’s responses with type 'assistant'
  • SDKUserMessage: User prompts with type 'user'
  • SDKResultMessage: Final results with type 'result' and subtypes:
    • 'success'
    • 'error_max_turns'
    • 'error_during_execution'
  • SDKSystemMessage: System messages with type 'system' and subtype 'init'
  • ErrorMessage: Custom error type with:
    • type: 'error'
    • message
    • timestamp

Node.js SDK

πŸ”— SDK Method: promptDeploymentStream Use this API endpoint with the Neynar Node.js SDK for typed responses and better developer experience.

Authorizations

x-api-key
string
header
default:NEYNAR_API_DOCS
required

API key to authorize requests

Body

application/json
prompt
string
required

Prompt string to send to the deployment

deployment_id
string<uuid>

Deployment ID (UUID). Required if name not provided.

fid
integer<int32>

Farcaster ID of the user; if not provided, namespace must be provided

Required range: x >= 0
Example:

3

name
string

Kubernetes deployment name. Required if deployment_id not provided.

namespace
string

Optional Kubernetes namespace. If not provided, will query for the active namespace for the given FID.

conversation_id
string<uuid>

Optional conversation ID to continue an existing chat. If not provided, a new conversation will be created.

session_id
string

Optional Claude SDK session ID to resume an existing Claude Code session. Enables session-based conversation continuity.

system_prompt_variant
enum<string>

System prompt variant to use. Defaults to stable if not provided.

Available options:
canary,
beta,
stable

Response

Success