Skip to main content

Overview

The /api/interview-copilot endpoint provides comprehensive assistance for technical coding interviews. It analyzes coding problems (optionally from screenshots) and returns structured solutions with problem analysis, clean code implementations, walkthroughs, test cases, and personalized mistake tracking based on user history.
This endpoint returns a structured JSON object (not plain text) via SSE streaming.

Endpoint

Authentication

Requires authentication via cookies or Authorization header.
Returns 401 Unauthorized if authentication fails.

Request Body

UIMessage[]
required
Array of conversation messages. The user message typically contains the coding problem description or question.
string
Optional conversation ID for persisting interview session history. If provided and the session doesn’t exist, a new one will be created with type "interview".
string
Optional base64-encoded screenshot of the coding problem. When provided, the AI will analyze the visual content along with the text message.
Useful for capturing LeetCode, HackerRank, or other coding platform problems directly from the screen.

Response

Returns a Server-Sent Events (SSE) stream containing a structured analysis object:
string
Problem analysis in GitHub-flavored Markdown format, including:
  • Key observations about the problem
  • Pattern recognition (e.g., “This is a sliding window problem”)
  • Approach and strategy
  • Time/Space complexity targets
  • Edge cases to consider
string
Clean, well-commented implementation code wrapped in triple backticks with language identifier.
string
Step-by-step explanation in Markdown with:
  • Detailed walkthrough of the solution
  • Complexity analysis table
  • Visual examples if applicable
array
Array of test case objects with edge cases and validation inputs.
array
Personalized array of common mistakes based on the user’s history. Retrieved from user’s stored memories.
array
All relevant memories retrieved about the user during analysis.

Available Tools

The endpoint uses memory tools to personalize the analysis:

Example Request

Example with Screenshot

Error Responses

error
Returned when messages parameter is missing or invalid.
error
Returned when authentication fails.

Features

  • Visual Analysis: Process screenshots of coding problems from any platform
  • Structured Output: Consistent JSON schema for easy parsing and display
  • Personalized Mistakes: Tracks and surfaces common errors from user history
  • Memory Integration: Remembers preferred languages, coding styles, and past struggles
  • Beautiful Formatting: All text fields use GitHub-flavored Markdown
  • Conversation Persistence: Saves full interview sessions with metadata
  • Automatic Stopping: Limits to 5 reasoning steps to ensure fast responses

Use Cases

  • Live Interview Assistance: Get real-time help during technical interviews
  • LeetCode Practice: Analyze and solve practice problems with personalized guidance
  • Learning from Mistakes: Track patterns in errors and improve over time
  • Interview Preparation: Study solutions with detailed explanations and complexity analysis
  • Code Review: Understand optimal approaches and edge cases for common problems

Best Practices

  • Include screenshots when possible for more accurate problem analysis
  • Use conversationId to maintain interview session history
  • The system learns from your coding patterns - more usage means better personalization
  • Review the mistakes field to avoid repeating common errors
  • Check memories to see what the system knows about your preferences