Skip to main content

Error Reference

Complete guide to NextEVI API errors, including error codes, common causes, and troubleshooting solutions.

Error Format

All API errors follow a consistent format:

WebSocket Errors

Connection Errors

Connection failures use WebSocket close codes with reason phrases:

Authentication Errors

AUTH_REQUIRED (4001)

HTTP Status: 401 Unauthorized
WebSocket Close Code: 4001
Cause: No authentication credentials provided in the connection request. Solutions:
  • Include api_key query parameter with valid API key
  • Include Authorization header with valid JWT token
  • Include authorization query parameter with JWT token

AUTH_FAILED (4001)

HTTP Status: 401 Unauthorized
WebSocket Close Code: 4001
Cause: Authentication credentials are invalid, expired, or malformed. Common Issues:
  • API key format incorrect (must start with oak_)
  • API key revoked or expired
  • JWT token expired or invalid signature
  • JWT token missing required claims
Solutions:

ACCESS_DENIED (4003)

HTTP Status: 403 Forbidden
WebSocket Close Code: 4003
Cause: Valid authentication but insufficient permissions for the requested resource. Common Issues:
  • API key doesn’t have access to specified project
  • JWT token missing required permissions
  • Account suspended or billing issues
Solutions:
  • Verify project permissions in NextEVI dashboard
  • Check account status and billing
  • Ensure JWT token includes required scopes
  • Contact support if permissions appear correct

Configuration Errors

CONFIG_NOT_FOUND (4004)

HTTP Status: 404 Not Found
WebSocket Close Code: 4004
Cause: The specified config_id does not exist or is not accessible. Solutions:
  • Verify config_id exists in your NextEVI dashboard
  • Check config_id spelling and format
  • Ensure config belongs to the correct project
  • Create a new config if necessary

INVALID_PROJECT (4004)

HTTP Status: 404 Not Found
WebSocket Close Code: 4004
Cause: The specified project_id is invalid or not accessible. Solutions:
  • Verify project_id in NextEVI dashboard
  • Remove project_id parameter to use auto-detection
  • Check project ownership and permissions

Connection Errors

CONNECTION_FAILED (4002)

WebSocket Close Code: 4002 Cause: Failed to establish or register the WebSocket connection. Common Issues:
  • Server overloaded or unavailable
  • Network connectivity problems
  • Invalid connection parameters
Solutions:
  • Retry connection with exponential backoff
  • Check network connectivity
  • Verify all required parameters are provided
  • Try connecting to a different region if available

CONNECTION_TIMEOUT (1001)

WebSocket Close Code: 1001 Cause: Connection timed out due to inactivity or network issues. Solutions:
  • Implement keep-alive messages
  • Check network stability
  • Reduce idle timeout if configurable
  • Implement automatic reconnection

Audio Processing Errors

AUDIO_PROCESSING_FAILED (5001)

Cause: Failed to process audio input data. Common Issues:
  • Invalid audio format or encoding
  • Corrupted audio data
  • Audio chunk too large
  • Unsupported sample rate
Solutions:

AUDIO_FORMAT_UNSUPPORTED (5002)

Cause: Audio format not supported by the processing pipeline. Supported Formats:
  • Encoding: linear16 (16-bit PCM)
  • Sample Rate: 24000 Hz
  • Channels: 1 (mono)
  • Bit Depth: 16 bits
Solutions:

AUDIO_CHUNK_TOO_LARGE (5003)

Cause: Audio chunk exceeds maximum allowed size. Limits:
  • Maximum chunk size: 1 MB
  • Recommended chunk size: 100-200 KB (100-200ms of audio)
Solutions:

Rate Limiting Errors

RATE_LIMITED (4004)

HTTP Status: 429 Too Many Requests
WebSocket Close Code: 4004
Cause: Exceeded rate limits for connections or messages. Rate Limits:
  • Connections: 100 per minute per API key
  • Messages: 1000 per minute per connection
  • Audio chunks: 100 per second per connection
Solutions:

Session Errors

SESSION_EXPIRED (5004)

Cause: Session has expired or been terminated. Common Causes:
  • Session exceeded maximum duration (60 minutes)
  • Inactivity timeout reached
  • Server restart or maintenance
Solutions:
  • Implement session refresh logic
  • Reconnect with new session
  • Handle graceful session termination

SESSION_LIMIT_EXCEEDED (5005)

Cause: Maximum number of concurrent sessions exceeded. Limits:
  • Free tier: 1 concurrent session
  • Pro tier: 10 concurrent sessions
  • Enterprise: Custom limits
Solutions:
  • Implement session management
  • Queue connections when at limit
  • Upgrade plan for higher limits

Server Errors

INTERNAL_ERROR (5000)

WebSocket Close Code: 1011 Cause: Internal server error occurred. Solutions:
  • Retry connection after delay
  • Check NextEVI status page
  • Contact support if error persists

SERVICE_UNAVAILABLE (5503)

HTTP Status: 503 Service Unavailable Cause: NextEVI service is temporarily unavailable. Solutions:
  • Implement exponential backoff retry
  • Check service status
  • Use fallback if available

Message Format Errors

INVALID_MESSAGE_FORMAT (4000)

Cause: Message does not conform to expected JSON schema. Common Issues:
  • Invalid JSON syntax
  • Missing required fields
  • Incorrect data types
Solutions:

UNSUPPORTED_MESSAGE_TYPE (4000)

Cause: Message type is not recognized or supported. Supported Client Message Types:
  • session_settings
  • audio_input
  • keep_alive
Solutions:

Troubleshooting Guide

Connection Issues

  1. Check authentication credentials
    • Verify API key format and validity
    • Ensure JWT tokens are not expired
    • Confirm config_id exists
  2. Verify network connectivity
    • Test basic internet connection
    • Check for firewall/proxy blocking WebSockets
    • Try connecting from different network
  3. Validate parameters
    • Ensure all required parameters are provided
    • Check parameter spelling and format
    • Verify project and config ownership

Audio Issues

  1. Check audio format
    • Verify 24kHz, 16-bit, mono PCM
    • Test with known good audio file
    • Validate base64 encoding
  2. Monitor chunk sizes
    • Keep chunks under 1MB
    • Aim for 100-200ms of audio per chunk
    • Implement chunking for large audio
  3. Handle microphone permissions
    • Request permissions explicitly
    • Provide fallback for denied permissions
    • Test on different browsers/devices

Performance Issues

  1. Monitor connection health
    • Track message latency
    • Monitor reconnection frequency
    • Log connection lifecycle events
  2. Implement proper error handling
    • Use exponential backoff for retries
    • Don’t retry authentication failures
    • Handle all error event types
  3. Optimize message flow
    • Batch non-critical messages
    • Use binary audio when possible
    • Implement client-side buffering

Getting Help

Support Channels

Support Information

When contacting support, please include:
  • Error Code: The specific error code received
  • Connection ID: From connection metadata
  • Timestamp: When the error occurred (UTC)
  • API Key: First 10 characters (e.g., oak_abc123...)
  • Code Sample: Minimal reproduction case
  • Browser/Environment: Version and environment details

Diagnostic Commands