{"components":{"parameters":{"ExpectedRevisionRequired":{"description":"Opaque revision token the skill must currently be at. The write applies\nonly if it matches, so it cannot race a concurrent update.\n","in":"query","name":"expected_revision","required":true,"schema":{"type":"string"}},"Limit":{"description":"Maximum items to return, 1 to 200; defaults to 50","in":"query","name":"limit","required":false,"schema":{"maximum":200,"minimum":1,"type":"integer"}},"PageToken":{"description":"Opaque token from a previous response's `next_page_token`","in":"query","name":"page_token","required":false,"schema":{"type":"string"}},"Revision":{"description":"Opaque revision token; when omitted, the active revision is used","in":"query","name":"revision","required":false,"schema":{"type":"string"}},"SkillId":{"description":"Skill identifier returned by create or `GET /v1/skills`","in":"path","name":"skill_id","required":true,"schema":{"type":"string"}}},"requestBodies":{"SkillBundle":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"The skill bundle, a zip archive containing `SKILL.md`","format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"description":"The skill bundle as a zip archive","required":true}},"schemas":{"AnalyticsErrorResponse":{"properties":{"error":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message","type"],"type":"object"}},"required":["error"],"type":"object"},"Annotation":{"description":"Text annotation (URL citation)","properties":{"end_index":{"description":"End character index of the annotated text","format":"int32","type":"integer"},"start_index":{"description":"Start character index of the annotated text","format":"int32","type":"integer"},"title":{"description":"Title of the cited source","type":"string"},"type":{"description":"Annotation type (url_citation)","type":"string"},"url":{"description":"URL of the cited source","type":"string"}},"title":"Annotation","type":"object"},"ApiChatCompletionsRequest":{"properties":{"disable_search":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"When true, disables all web search capabilities. The model responds based solely on its training data","title":"Disable Search"},"enable_search_classifier":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"When true, uses a classifier to determine if web search is needed for the query","title":"Enable Search Classifier"},"image_domain_filter":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Limit image results to specific domains","title":"Image Domain Filter"},"image_format_filter":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Filter image results by format (e.g. png, jpg)","title":"Image Format Filter"},"language_preference":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 639-1 language code for preferred response language","title":"Language Preference"},"last_updated_after_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return results last updated after this date (MM/DD/YYYY)","title":"Last Updated After Filter"},"last_updated_before_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return results last updated before this date (MM/DD/YYYY)","title":"Last Updated Before Filter"},"max_tokens":{"anyOf":[{"exclusiveMinimum":0,"maximum":128000,"type":"integer"},{"type":"null"}],"description":"Maximum number of completion tokens to generate","title":"Max Tokens"},"messages":{"description":"Array of messages forming the conversation history","items":{"$ref":"#/components/schemas/ChatMessage-Input"},"title":"Messages","type":"array"},"model":{"description":"Model to use, for example, sonar-pro","enum":["sonar","sonar-pro","sonar-deep-research","sonar-reasoning-pro"],"title":"Model","type":"string"},"reasoning_effort":{"anyOf":[{"enum":["minimal","low","medium","high"],"type":"string"},{"type":"null"}],"description":"Controls how much effort the model spends on reasoning","title":"Reasoning Effort"},"response_format":{"anyOf":[{"$ref":"#/components/schemas/ResponseFormatText"},{"$ref":"#/components/schemas/ResponseFormatJSONSchema"},{"type":"null"}],"description":"Optional. Controls the output format. Omit for default text output. Set `type` to `json_schema` for structured output.","discriminator":{"mapping":{"json_schema":"#/components/schemas/ResponseFormatJSONSchema","text":"#/components/schemas/ResponseFormatText"},"propertyName":"type"},"title":"Response Format"},"return_images":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"When true, include image results in the response","title":"Return Images"},"return_related_questions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"When true, generates suggested follow-up queries based on the search results","title":"Return Related Questions"},"search_after_date_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return results published after this date (MM/DD/YYYY)","title":"Search After Date Filter"},"search_before_date_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return results published before this date (MM/DD/YYYY)","title":"Search Before Date Filter"},"search_domain_filter":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Limit search results to specific domains (e.g. github.com, wikipedia.org)","title":"Search Domain Filter"},"search_language_filter":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Filter results by language using ISO 639-1 codes (e.g. en, fr, de)","title":"Search Language Filter"},"search_mode":{"anyOf":[{"enum":["web","academic","sec"],"type":"string"},{"type":"null"}],"description":"Source of search results (web, academic, or sec)","title":"Search Mode"},"search_recency_filter":{"anyOf":[{"enum":["hour","day","week","month","year"],"type":"string"},{"type":"null"}],"description":"Filter by publication recency (hour, day, week, month, or year)","title":"Search Recency Filter"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Stop sequences. Generation stops when one of these strings is produced","title":"Stop"},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"If true, returns streaming SSE response","title":"Stream"},"stream_mode":{"default":"full","description":"Controls the format of streaming events. 'full' suppresses reasoning events and includes metadata inline; 'concise' emits reasoning events separately","enum":["full","concise"],"title":"Stream Mode","type":"string"},"temperature":{"anyOf":[{"maximum":2,"minimum":0,"type":"number"},{"type":"null"}],"description":"Controls randomness in the response. Higher values make output more random. Range: 0-2","title":"Temperature"},"top_p":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"description":"Nucleus sampling parameter. Controls diversity via nucleus sampling","title":"Top P"},"web_search_options":{"$ref":"#/components/schemas/WebSearchOptions"}},"required":["messages","model"],"title":"ApiChatCompletionsRequest","type":"object"},"ApiError":{"properties":{"error":{"properties":{"code":{"description":"HTTP status code","type":"integer"},"message":{"description":"Human-readable error message","type":"string"},"param":{"description":"Parameter that caused the error","type":["null","string"]},"type":{"description":"Error type identifier","type":"string"}},"required":["code","message","type"],"type":"object"}},"type":"object"},"ApiPublicSearchResult":{"description":"A single search result from the web","properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Publication date of the result","title":"Date"},"last_updated":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Date the result was last updated","title":"Last Updated"},"snippet":{"default":"","description":"Text snippet from the search result","title":"Snippet","type":"string"},"source":{"default":"web","description":"Source type of the result (web or attachment)","enum":["web","attachment"],"title":"Source","type":"string"},"title":{"description":"Title of the search result page","title":"Title","type":"string"},"url":{"description":"URL of the search result page","title":"Url","type":"string"}},"required":["title","url"],"title":"ApiPublicSearchResult","type":"object"},"ApiSearchPage":{"description":"A single page from search results","properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Publication date of the page","title":"Date"},"last_updated":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Date the page was last updated","title":"Last Updated"},"snippet":{"description":"Content snippet extracted from the page","title":"Snippet","type":"string"},"title":{"description":"Title of the page","title":"Title","type":"string"},"url":{"description":"URL of the page","title":"Url","type":"string"}},"required":["snippet","title","url"],"title":"ApiSearchPage","type":"object"},"ApiSearchRequest":{"allOf":[{"properties":{"country":{"description":"ISO 3166-1 alpha-2 country code","maxLength":2,"minLength":2,"type":"string"},"max_results":{"default":10,"description":"Maximum number of results. Values above 20 require search_type=people. Supports up to 20 for web search and up to 50 for people search.","maximum":50,"minimum":1,"type":"integer"},"max_tokens":{"description":"Maximum total webpage content tokens to return across all search results","maximum":1000000,"minimum":1,"type":"integer"},"max_tokens_per_page":{"description":"Maximum webpage content tokens to extract from each result page","maximum":1000000,"minimum":1,"type":"integer"},"query":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"description":"Search query (required)","title":"Query"},"search_context_size":{"description":"Controls how much content is extracted from result pages.\n\n- `low` — short passages most relevant to the query.\n- `medium` — a balanced amount of content per document.\n- `high` (default) — detailed content relevant to the query.\n\nOmit when using `max_tokens` or `max_tokens_per_page`.","type":"string"},"search_language_filter":{"description":"ISO 639-1 language codes (2-character max)","items":{"maxLength":2,"minLength":2,"type":"string"},"maxItems":20,"type":"array"},"search_type":{"default":"web","description":"Search type - \"web\" for general web search, \"fast\" for lower-latency, lower-cost web search, \"people\" for people search. max_results above 20 is only supported for people search.","enum":["web","fast","people"],"type":"string"}},"required":["query"],"type":"object"},{"$ref":"#/components/schemas/SearchDomainFilter"},{"$ref":"#/components/schemas/DateFilters"}],"title":"ApiSearchRequest","type":"object"},"ApiSearchResponse":{"properties":{"id":{"title":"Id","type":"string"},"results":{"items":{"$ref":"#/components/schemas/ApiSearchPage"},"title":"Results","type":"array"},"server_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Server Time"}},"required":["id","results"],"title":"ApiSearchResponse","type":"object"},"AsyncApiChatCompletionsRequest":{"description":"Request body for creating an asynchronous chat completion","properties":{"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unique key to prevent duplicate requests","title":"Idempotency Key"},"request":{"$ref":"#/components/schemas/ApiChatCompletionsRequest","description":"The chat completion request to execute asynchronously"}},"required":["request"],"title":"AsyncApiChatCompletionsRequest","type":"object"},"AsyncApiChatCompletionsResponse":{"properties":{"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Unix timestamp when processing completed","title":"Completed At"},"created_at":{"description":"Unix timestamp when the request was created","title":"Created At","type":"integer"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Error message if the request failed","title":"Error Message"},"failed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Unix timestamp when the request failed (if applicable)","title":"Failed At"},"id":{"description":"Unique identifier for the async request","title":"Id","type":"string"},"model":{"description":"Model used for the request","title":"Model","type":"string"},"response":{"anyOf":[{"$ref":"#/components/schemas/CompletionResponse"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Unix timestamp when processing started","title":"Started At"},"status":{"$ref":"#/components/schemas/AsyncProcessingStatus","description":"Current processing status of the request"}},"required":["created_at","id","model","status"],"title":"AsyncApiChatCompletionsResponse","type":"object"},"AsyncApiChatCompletionsResponseSummary":{"properties":{"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completed At"},"created_at":{"title":"Created At","type":"integer"},"failed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed At"},"id":{"title":"Id","type":"string"},"model":{"title":"Model","type":"string"},"started_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Started At"},"status":{"$ref":"#/components/schemas/AsyncProcessingStatus"}},"required":["created_at","id","model","status"],"title":"AsyncApiChatCompletionsResponseSummary","type":"object"},"AsyncProcessingStatus":{"description":"Status enum for async processing.","enum":["CREATED","IN_PROGRESS","COMPLETED","FAILED"],"title":"AsyncProcessingStatus","type":"string"},"BuiltinSkill":{"additionalProperties":false,"properties":{"name":{"description":"Built-in skill to make available to the model. office is the full Office bundle (enables all four leaves). office/docx, office/pdf, office/pptx, office/xlsx each create polished documents of that type from scratch, with structural validation and visual QA.","enum":["office","office/docx","office/pdf","office/pptx","office/xlsx"],"type":"string"},"type":{"enum":["builtin"],"type":"string"}},"required":["name","type"],"title":"BuiltinSkill","type":"object"},"ChatMessage-Input":{"properties":{"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatMessageContentTextChunk"},{"$ref":"#/components/schemas/ChatMessageContentImageChunk"},{"$ref":"#/components/schemas/ChatMessageContentFileChunk"},{"$ref":"#/components/schemas/ChatMessageContentPDFChunk"},{"$ref":"#/components/schemas/ChatMessageContentVideoChunk"}]},"title":"Structured Content","type":"array"},{"type":"null"}],"title":"Content"},"role":{"$ref":"#/components/schemas/ChatMessageRole"}},"required":["content","role"],"title":"ChatMessage","type":"object"},"ChatMessage-Output":{"properties":{"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatMessageContentTextChunk"},{"$ref":"#/components/schemas/ChatMessageContentImageChunk"},{"$ref":"#/components/schemas/ChatMessageContentFileChunk"},{"$ref":"#/components/schemas/ChatMessageContentPDFChunk"},{"$ref":"#/components/schemas/ChatMessageContentVideoChunk"}]},"title":"Structured Content","type":"array"},{"type":"null"}],"title":"Content"},"role":{"$ref":"#/components/schemas/ChatMessageRole"}},"required":["content","role"],"title":"ChatMessage","type":"object"},"ChatMessageContentFileChunk":{"properties":{"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"file_url":{"anyOf":[{"$ref":"#/components/schemas/URL"},{"type":"string"}],"title":"File Url"},"type":{"const":"file_url","title":"Type","type":"string"}},"required":["file_url","type"],"title":"ChatMessageContentFileChunk","type":"object"},"ChatMessageContentImageChunk":{"properties":{"image_url":{"anyOf":[{"$ref":"#/components/schemas/URL"},{"type":"string"}],"title":"Image Url"},"type":{"const":"image_url","title":"Type","type":"string"}},"required":["image_url","type"],"title":"ChatMessageContentImageChunk","type":"object"},"ChatMessageContentPDFChunk":{"properties":{"pdf_url":{"anyOf":[{"$ref":"#/components/schemas/URL"},{"type":"string"}],"title":"Pdf Url"},"type":{"const":"pdf_url","title":"Type","type":"string"}},"required":["pdf_url","type"],"title":"ChatMessageContentPDFChunk","type":"object"},"ChatMessageContentTextChunk":{"properties":{"text":{"title":"Text","type":"string"},"type":{"const":"text","title":"Type","type":"string"}},"required":["text","type"],"title":"ChatMessageContentTextChunk","type":"object"},"ChatMessageContentVideoChunk":{"properties":{"type":{"const":"video_url","title":"Type","type":"string"},"video_url":{"anyOf":[{"$ref":"#/components/schemas/VideoURL"},{"type":"string"}],"title":"Video Url"}},"required":["type","video_url"],"title":"ChatMessageContentVideoChunk","type":"object"},"ChatMessageRole":{"description":"Chat roles enum","enum":["system","user","assistant","tool"],"title":"ChatMessageRole","type":"string"},"Choice":{"description":"A single completion choice","properties":{"delta":{"$ref":"#/components/schemas/ChatMessage-Output","description":"Incremental message delta (streaming)"},"finish_reason":{"anyOf":[{"enum":["stop","length"],"type":"string"},{"type":"null"}],"description":"Reason generation stopped (stop or length)","title":"Finish Reason"},"index":{"description":"Index of the choice in the array","title":"Index","type":"integer"},"message":{"$ref":"#/components/schemas/ChatMessage-Output","description":"Complete message (non-streaming)"}},"required":["delta","index","message"],"title":"Choice","type":"object"},"CompletionResponse":{"properties":{"choices":{"description":"Array of completion choices","items":{"$ref":"#/components/schemas/Choice"},"title":"Choices","type":"array"},"citations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"URLs of sources used to generate the response","title":"Citations"},"created":{"description":"Unix timestamp when the completion was created","title":"Created","type":"integer"},"id":{"description":"Unique identifier for the completion","title":"Id","type":"string"},"images":{"anyOf":[{"items":{"$ref":"#/components/schemas/ImageResult"},"type":"array"},{"type":"null"}],"description":"Array of images returned when return_images is true","title":"Images"},"model":{"description":"Model used for generation","title":"Model","type":"string"},"object":{"default":"chat.completion","description":"Object type identifier","title":"Object","type":"string"},"related_questions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Array of related questions returned when return_related_questions is true","title":"Related Questions"},"search_results":{"anyOf":[{"items":{"$ref":"#/components/schemas/ApiPublicSearchResult"},"type":"array"},{"type":"null"}],"description":"Search results used for context in the response","title":"Search Results"},"usage":{"anyOf":[{"$ref":"#/components/schemas/UsageInfo"},{"type":"null"}]}},"required":["choices","created","id","model"],"title":"CompletionResponse","type":"object"},"ComputerUsageBucket":{"properties":{"by_categories":{"additionalProperties":{"items":{"$ref":"#/components/schemas/ComputerUsageCategoryCount"},"type":"array"},"description":"Category breakdowns for this bucket, keyed by the labels declared in the response's top-level `categories` list. An empty list means the bucket has no data for that breakdown.","type":"object"},"count":{"description":"Bucket total. For credit_usage this may exceed the sum of any single breakdown — usage without a category attribution counts toward the total but not the breakdown.","type":"integer"},"end_time":{"description":"Bucket end in unix seconds (UTC), exclusive.","type":"integer"},"start_time":{"description":"Bucket start in unix seconds (UTC), inclusive.","type":"integer"}},"required":["by_categories","count","end_time","start_time"],"type":"object"},"ComputerUsageCategoryCount":{"description":"A bucket's count for one value of a category breakdown — e.g. a connector name for connectors, a duration band for task_durations, or paid/promo for credit_usage's Credit Source axis.","properties":{"category":{"type":"string"},"count":{"type":"integer"}},"required":["category","count"],"type":"object"},"ComputerUsageResponse":{"properties":{"categories":{"description":"Category breakdown labels the requested dataset surfaces, in canonical render order. Each label is a key in every bucket's `by_categories`.","items":{"type":"string"},"type":"array"},"data":{"description":"Every bucket in the page's window, in chronological order. Buckets without data carry count 0 and an empty breakdown.","items":{"$ref":"#/components/schemas/ComputerUsageBucket"},"type":"array"},"has_more":{"description":"Whether more buckets exist beyond this page. False also when the window's remaining buckets are past the current data frontier.","type":"boolean"},"next_page":{"description":"Cursor for the next page; pass as the page parameter with otherwise identical query parameters.","type":["null","string"]}},"required":["categories","data","has_more"],"type":"object"},"ComputerUsageV2Bucket":{"properties":{"end_time":{"description":"Day end in unix seconds (UTC), exclusive.","type":"integer"},"results":{"description":"One row per member with credit usage on this day.","items":{"$ref":"#/components/schemas/ComputerUsageV2Result"},"type":"array"},"start_time":{"description":"Day start in unix seconds (UTC), inclusive.","type":"integer"}},"required":["end_time","results","start_time"],"type":"object"},"ComputerUsageV2Response":{"properties":{"categories":{"description":"Category breakdown labels each member row surfaces, in canonical render order. Each label is a key in every row's `by_categories`.","items":{"type":"string"},"type":"array"},"data":{"description":"Daily buckets in chronological order, each with one row per member who used credits that day. Days with no attributable usage are omitted.","items":{"$ref":"#/components/schemas/ComputerUsageV2Bucket"},"type":"array"},"has_more":{"description":"Whether more member rows exist beyond this page.","type":"boolean"},"next_page":{"description":"Cursor for the next page; pass as the page parameter with otherwise identical query parameters.","type":["null","string"]}},"required":["categories","data","has_more"],"type":"object"},"ComputerUsageV2Result":{"description":"One member's credit usage for a single day.","properties":{"by_categories":{"additionalProperties":{"items":{"$ref":"#/components/schemas/ComputerUsageCategoryCount"},"type":"array"},"description":"The member's day broken down by each label in the response's top-level `categories` list.","type":"object"},"count":{"description":"The member's credit total for the day. May exceed the sum of any single breakdown — usage without a category attribution counts toward the total but not the breakdown.","type":"integer"},"user_email":{"description":"The member's email. Rows whose member can no longer be resolved to an email are omitted.","type":"string"}},"required":["by_categories","count","user_email"],"type":"object"},"ConnectorTool":{"description":"A Perplexity-managed connector scoped to the authenticated API organization.","properties":{"allowed_tools":{"description":"Optional exact-name allowlist. Omitted or empty admits every live tool.","items":{"type":"string"},"type":"array"},"id":{"description":"Opaque connector identifier.","type":"string"},"server_description":{"description":"Optional model-facing namespace description.","type":"string"},"server_label":{"description":"Unique per request, ^[a-zA-Z0-9_-]{1,64}$. Namespaces the connector's tools.","type":"string"},"type":{"enum":["connector"],"type":"string"}},"required":["id","server_label","type"],"title":"ConnectorTool","type":"object"},"ContentPart":{"properties":{"annotations":{"items":{"$ref":"#/components/schemas/Annotation"},"type":"array"},"text":{"type":"string"},"type":{"$ref":"#/components/schemas/ContentPartType"}},"required":["text","type"],"title":"ContentPart","type":"object"},"ContentPartType":{"description":"Type of a content part","enum":["output_text"],"title":"ContentPartType","type":"string"},"ContextualizedEmbeddingObject":{"description":"A single contextualized embedding result","properties":{"data":{"description":"List of embedding objects for chunks in this document","items":{"$ref":"#/components/schemas/EmbeddingObject"},"title":"Data","type":"array"},"index":{"description":"The index of the document this chunk belongs to","title":"Index","type":"integer"},"object":{"description":"The object type","example":"list","title":"Object","type":"string"}},"title":"Contextualized Embedding Object","type":"object"},"ContextualizedEmbeddingsRequest":{"description":"Request body for creating contextualized embeddings","properties":{"dimensions":{"description":"Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-context-v1-0.6b, 128-2560 for pplx-embed-context-v1-4b. Defaults to full dimensions (1024 or 2560).","maximum":2560,"minimum":128,"title":"Dimensions","type":"integer"},"encoding_format":{"default":"base64_int8","description":"Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).","enum":["base64_int8","base64_binary"],"title":"Encoding Format","type":"string"},"input":{"description":"Nested array structure where each inner array contains chunks from a single document. Chunks within the same document are encoded with document-level context awareness. Maximum 512 documents. Total chunks across all documents must not exceed 16,000. Total tokens per document must not exceed 32K. All chunks in a single request must not exceed 120,000 tokens combined. Empty strings are not allowed.","items":{"items":{"minLength":1,"type":"string"},"minItems":1,"type":"array"},"maxItems":512,"minItems":1,"title":"Input","type":"array"},"model":{"description":"The contextualized embedding model to use","enum":["pplx-embed-context-v1-0.6b","pplx-embed-context-v1-4b"],"title":"Model","type":"string"}},"required":["input","model"],"title":"Contextualized Embeddings Request","type":"object"},"ContextualizedEmbeddingsResponse":{"description":"Response body for contextualized embeddings request","properties":{"data":{"description":"List of contextualized embedding objects","items":{"$ref":"#/components/schemas/ContextualizedEmbeddingObject"},"title":"Data","type":"array"},"model":{"description":"The model used to generate embeddings","title":"Model","type":"string"},"object":{"description":"The object type","example":"list","title":"Object","type":"string"},"usage":{"$ref":"#/components/schemas/EmbeddingsUsage"}},"title":"Contextualized Embeddings Response","type":"object"},"Cost":{"description":"Cost breakdown for a chat completion request","properties":{"citation_tokens_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Cost for citation tokens in USD","title":"Citation Tokens Cost"},"input_tokens_cost":{"description":"Cost for input tokens in USD","title":"Input Tokens Cost","type":"number"},"output_tokens_cost":{"description":"Cost for output tokens in USD","title":"Output Tokens Cost","type":"number"},"reasoning_tokens_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Cost for reasoning tokens in USD","title":"Reasoning Tokens Cost"},"request_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Cost for web search requests in USD (includes pro search cost if applicable)","title":"Request Cost"},"search_queries_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Cost for search queries in USD","title":"Search Queries Cost"},"total_cost":{"description":"Total cost for the request in USD","title":"Total Cost","type":"number"}},"required":["input_tokens_cost","output_tokens_cost","total_cost"],"title":"Cost","type":"object"},"Currency":{"description":"Currency code for cost values","enum":["USD"],"type":"string"},"CustomSkill":{"additionalProperties":false,"properties":{"id":{"description":"Identifier of an organization-owned skill stored in Perplexity, in the form skill_<id>.","maxLength":128,"minLength":1,"type":"string"},"type":{"enum":["custom"],"type":"string"},"version":{"description":"Revision to load, or \"latest\". Omitted means \"latest\".","type":"string"}},"required":["id","type"],"title":"CustomSkill","type":"object"},"Date":{"description":"Input: MM/DD/YYYY, Output: YYYY-MM-DD","title":"Date","type":"string"},"DateFilters":{"properties":{"last_updated_after_filter":{"$ref":"#/components/schemas/Date","description":"Return results updated after this date (MM/DD/YYYY)"},"last_updated_before_filter":{"$ref":"#/components/schemas/Date","description":"Return results updated before this date (MM/DD/YYYY)"},"search_after_date_filter":{"$ref":"#/components/schemas/Date","description":"Return results published after this date (MM/DD/YYYY)"},"search_before_date_filter":{"$ref":"#/components/schemas/Date","description":"Return results published before this date (MM/DD/YYYY)"},"search_recency_filter":{"$ref":"#/components/schemas/SearchRecencyFilter","description":"Filter by publication recency (hour/day/week/month/year)"}},"title":"DateFilters","type":"object"},"EmbeddingObject":{"description":"A single embedding result","properties":{"embedding":{"description":"Base64-encoded embedding vector. For base64_int8: decode to signed int8 array (length = dimensions). For base64_binary: decode to packed bits (length = dimensions / 8 bytes).","title":"Embedding","type":"string"},"index":{"description":"The index of the input text this embedding corresponds to","title":"Index","type":"integer"},"object":{"description":"The object type","example":"embedding","title":"Object","type":"string"}},"title":"Embedding Object","type":"object"},"EmbeddingsRequest":{"description":"Request body for creating embeddings","properties":{"dimensions":{"description":"Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-v1-0.6b, 128-2560 for pplx-embed-v1-4b. Defaults to full dimensions (1024 or 2560).","maximum":2560,"minimum":128,"title":"Dimensions","type":"integer"},"encoding_format":{"default":"base64_int8","description":"Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).","enum":["base64_int8","base64_binary"],"title":"Encoding Format","type":"string"},"input":{"description":"Input text to embed, encoded as a string or array of strings. Maximum 512 texts per request. Each input must not exceed 32K tokens. All inputs in a single request must not exceed 120,000 tokens combined. Empty strings are not allowed.","oneOf":[{"minLength":1,"type":"string"},{"items":{"minLength":1,"type":"string"},"maxItems":512,"minItems":1,"type":"array"}],"title":"Input"},"model":{"description":"The embedding model to use","enum":["pplx-embed-v1-0.6b","pplx-embed-v1-4b"],"title":"Model","type":"string"}},"required":["input","model"],"title":"Embeddings Request","type":"object"},"EmbeddingsResponse":{"description":"Response body for embeddings request","properties":{"data":{"description":"List of embedding objects","items":{"$ref":"#/components/schemas/EmbeddingObject"},"title":"Data","type":"array"},"model":{"description":"The model used to generate embeddings","title":"Model","type":"string"},"object":{"description":"The object type","example":"list","title":"Object","type":"string"},"usage":{"$ref":"#/components/schemas/EmbeddingsUsage"}},"title":"Embeddings Response","type":"object"},"EmbeddingsUsage":{"description":"Token usage for the embeddings request","properties":{"cost":{"description":"Cost breakdown for the request","properties":{"currency":{"description":"Currency of the cost values","enum":["USD"],"title":"Currency","type":"string"},"input_cost":{"description":"Cost for input tokens in USD","title":"Input Cost","type":"number"},"total_cost":{"description":"Total cost for the request in USD","title":"Total Cost","type":"number"}},"title":"Cost","type":"object"},"prompt_tokens":{"description":"Number of tokens in the input texts","title":"Prompt Tokens","type":"integer"},"total_tokens":{"description":"Total number of tokens processed","title":"Total Tokens","type":"integer"}},"title":"Embeddings Usage","type":"object"},"ErrorInfo":{"description":"Error information returned when a request fails","properties":{"code":{"description":"Error code","type":"string"},"message":{"description":"Human-readable error message","type":"string"},"type":{"description":"Error type category","type":"string"}},"required":["message"],"title":"ErrorInfo","type":"object"},"EventType":{"description":"SSE event type discriminator","enum":["response.created","response.in_progress","response.completed","response.failed","response.output_item.added","response.output_item.done","response.output_text.delta","response.output_text.done","response.reasoning.started","response.reasoning.search_queries","response.reasoning.search_results","response.reasoning.fetch_url_queries","response.reasoning.fetch_url_results","response.reasoning.stopped"],"title":"EventType","type":"string"},"FetchUrlQueriesEvent":{"description":"URL fetch queries event (type: \"response.reasoning.fetch_url_queries\").\nContains URLs being fetched.\n","properties":{"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"thought":{"type":"string"},"type":{"$ref":"#/components/schemas/EventType"},"urls":{"items":{"type":"string"},"type":"array"}},"required":["sequence_number","type","urls"],"title":"FetchUrlQueriesEvent","type":"object"},"FetchUrlResultsEvent":{"description":"URL fetch results event (type: \"response.reasoning.fetch_url_results\").\nContains fetched URL contents.\n","properties":{"contents":{"items":{"$ref":"#/components/schemas/UrlContent"},"type":"array"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"thought":{"type":"string"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["contents","sequence_number","type"],"title":"FetchUrlResultsEvent","type":"object"},"FetchUrlResultsOutputItem":{"properties":{"contents":{"items":{"$ref":"#/components/schemas/UrlContent"},"type":"array"},"type":{"enum":["fetch_url_results"],"type":"string"}},"required":["contents","type"],"title":"FetchUrlResultsOutputItem","type":"object"},"FetchUrlTool":{"properties":{"max_urls":{"description":"Maximum number of URLs to fetch per tool call","format":"int32","maximum":10,"minimum":1,"type":"integer"},"type":{"enum":["fetch_url"],"type":"string"}},"required":["type"],"title":"FetchUrlTool","type":"object"},"FinanceResult":{"description":"A single structured finance result returned by the finance_search tool.","properties":{"category":{"description":"Finance category this result belongs to (for example, \"quote\").","type":"string"},"content":{"description":"Structured content for the result, typically a markdown-formatted table or snippet.","type":"string"},"sources":{"description":"Source URLs backing the structured content.","items":{"type":"string"},"type":"array"},"tickers":{"description":"Ticker symbols this result pertains to.","items":{"type":"string"},"type":"array"}},"required":["category","content"],"title":"FinanceResult","type":"object"},"FinanceResultsOutputItem":{"description":"Intermediate output item emitted when the finance_search tool runs. One item is emitted per tool invocation; the requested categories and tickers are echoed at the envelope level alongside the per-result entries.","properties":{"categories":{"description":"Finance categories the tool was asked to retrieve for this invocation (for example, \"quote\").","items":{"type":"string"},"type":"array"},"results":{"description":"Structured finance results returned for the invocation.","items":{"$ref":"#/components/schemas/FinanceResult"},"type":"array"},"tickers":{"description":"Ticker symbols the tool was asked to retrieve for this invocation.","items":{"type":"string"},"type":"array"},"type":{"enum":["finance_results"],"type":"string"}},"required":["results","type"],"title":"FinanceResultsOutputItem","type":"object"},"FinanceSearchTool":{"description":"Finance search tool configuration for the Agent API","properties":{"type":{"description":"Tool type identifier","enum":["finance_search"],"type":"string"}},"required":["type"],"title":"FinanceSearchTool","type":"object"},"FunctionCallInput":{"properties":{"arguments":{"description":"Function arguments (JSON string)","type":"string"},"call_id":{"description":"The call_id that correlates with function_call_output","type":"string"},"name":{"description":"The function name","type":"string"},"thought_signature":{"description":"Base64-encoded signature for thinking models","type":"string"},"type":{"enum":["function_call"],"type":"string"}},"required":["arguments","call_id","name","type"],"title":"FunctionCallInput","type":"object"},"FunctionCallOutputImagePart":{"additionalProperties":false,"properties":{"detail":{"description":"Accepted for OpenAI replay compatibility; native tool-result forwarding ignores this hint.","enum":["low","high","auto"],"type":["null","string"]},"image_url":{"description":"A fully qualified HTTP(S) URL or base64 image data URI.","type":"string"},"type":{"enum":["input_image"],"type":"string"}},"required":["image_url","type"],"title":"FunctionCallOutputImagePart","type":"object"},"FunctionCallOutputInput":{"additionalProperties":false,"properties":{"call_id":{"description":"The call_id from function_call output","type":"string"},"id":{"description":"Replay metadata populated when this item was returned by the API.","type":["null","string"]},"name":{"description":"Function name (required by some providers)","type":"string"},"output":{"description":"Function result as a JSON string or an array of input_text and input_image content parts.","oneOf":[{"title":"StringOutput","type":"string"},{"items":{"discriminator":{"mapping":{"input_image":"#/components/schemas/FunctionCallOutputImagePart","input_text":"#/components/schemas/FunctionCallOutputTextPart"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/FunctionCallOutputTextPart"},{"$ref":"#/components/schemas/FunctionCallOutputImagePart"}]},"title":"OutputPartArray","type":"array"}]},"status":{"description":"Replay metadata populated when this item was returned by the API.","enum":["in_progress","completed","incomplete"],"type":["null","string"]},"thought_signature":{"description":"Base64-encoded signature from function_call","type":"string"},"type":{"enum":["function_call_output"],"type":"string"}},"required":["call_id","output","type"],"title":"FunctionCallOutputInput","type":"object"},"FunctionCallOutputItem":{"properties":{"arguments":{"description":"JSON string of arguments","type":"string"},"call_id":{"description":"Correlates with function_call_output input","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/Status"},"thought_signature":{"description":"Base64-encoded opaque signature for thinking models","type":"string"},"type":{"enum":["function_call"],"type":"string"}},"required":["arguments","call_id","id","name","status","type"],"title":"FunctionCallOutputItem","type":"object"},"FunctionCallOutputTextPart":{"additionalProperties":false,"properties":{"text":{"type":"string"},"type":{"enum":["input_text"],"type":"string"}},"required":["text","type"],"title":"FunctionCallOutputTextPart","type":"object"},"FunctionTool":{"properties":{"description":{"description":"A description of what the function does","type":"string"},"name":{"description":"The name of the function","type":"string"},"parameters":{"additionalProperties":true,"description":"JSON Schema defining the function's parameters","type":"object"},"strict":{"description":"Whether to enable strict schema validation","type":"boolean"},"type":{"enum":["function"],"type":"string"}},"required":["name","type"],"title":"FunctionTool","type":"object"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ImageResult":{"properties":{"height":{"description":"Height of the image in pixels","title":"Height","type":"integer"},"image_url":{"description":"URL of the image","title":"Image Url","type":"string"},"origin_url":{"description":"Original URL where the image was found","title":"Origin Url","type":"string"},"title":{"description":"Title or description of the image","title":"Title","type":"string"},"width":{"description":"Width of the image in pixels","title":"Width","type":"integer"}},"required":["height","image_url","origin_url","title","width"],"title":"ImageResult","type":"object"},"InlineSkill":{"additionalProperties":false,"properties":{"description":{"description":"Short discovery description, limited to 1,024 UTF-8 bytes.","maxLength":1024,"minLength":1,"type":"string"},"instructions":{"description":"Instructions returned by load_skill, limited to 65,536 UTF-8 bytes per skill and 262,144 bytes across the request.","maxLength":65536,"minLength":1,"type":"string"},"name":{"description":"Request-scoped lowercase ASCII name separated by single hyphens.","maxLength":64,"minLength":1,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","type":"string"},"type":{"enum":["inline"],"type":"string"}},"required":["description","instructions","name","type"],"title":"InlineSkill","type":"object"},"Input":{"description":"Input content - either a string or array of input items","oneOf":[{"title":"StringInput","type":"string"},{"items":{"$ref":"#/components/schemas/InputItem"},"title":"InputItemArray","type":"array"}],"title":"Input"},"InputContent":{"description":"Message content - either a string or array of content parts","oneOf":[{"title":"StringContent","type":"string"},{"items":{"$ref":"#/components/schemas/InputContentPart"},"title":"ContentPartArray","type":"array"}],"title":"InputContent"},"InputContentPart":{"properties":{"image_url":{"maxLength":2048,"type":"string"},"text":{"type":"string"},"type":{"enum":["input_text","input_image"],"type":"string"}},"required":["type"],"title":"InputContentPart","type":"object"},"InputItem":{"discriminator":{"mapping":{"function_call":"#/components/schemas/FunctionCallInput","function_call_output":"#/components/schemas/FunctionCallOutputInput","message":"#/components/schemas/InputMessage"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/InputMessage"},{"$ref":"#/components/schemas/FunctionCallOutputInput"},{"$ref":"#/components/schemas/FunctionCallInput"}],"title":"InputItem"},"InputMessage":{"properties":{"content":{"$ref":"#/components/schemas/InputContent"},"role":{"enum":["user","assistant","system","developer"],"type":"string"},"type":{"enum":["message"],"type":"string"}},"required":["content","role","type"],"title":"InputMessage","type":"object"},"JSONSchema":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"schema","title":"Name"},"schema":{"additionalProperties":true,"title":"Schema","type":"object"},"strict":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Strict"}},"required":["schema"],"title":"JSONSchema","type":"object"},"JSONSchemaFormat":{"description":"Defines a JSON schema for structured output validation","properties":{"description":{"description":"Optional description of the schema","type":"string"},"name":{"description":"Name of the schema (1-64 alphanumeric chars)","maxLength":64,"minLength":1,"type":"string"},"schema":{"additionalProperties":true,"description":"The JSON schema object","type":"object"},"strict":{"description":"Whether to enforce strict schema validation","type":"boolean"}},"required":["name","schema"],"title":"JSONSchemaFormat","type":"object"},"ListAsyncApiChatCompletionsResponse":{"properties":{"next_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Token"},"requests":{"items":{"$ref":"#/components/schemas/AsyncApiChatCompletionsResponseSummary"},"title":"Requests","type":"array"}},"required":["requests"],"title":"ListAsyncApiChatCompletionsResponse","type":"object"},"ListModelsResponse":{"description":"Response from the List Models endpoint. Contains a list of available models.","properties":{"data":{"description":"A list of model objects.","items":{"$ref":"#/components/schemas/Model"},"type":"array"},"object":{"description":"The object type, which is always `list`.","enum":["list"],"example":"list","type":"string"}},"required":["data","object"],"type":"object"},"ManagedSkill":{"properties":{"created_at":{"format":"date-time","type":"string"},"description":{"description":"Skill description, read from the bundle's `SKILL.md`","type":"string"},"latest_revision":{"description":"Opaque token of the skill's current latest revision; pass as expected_revision to update or delete","type":"string"},"name":{"description":"Skill name, read from the bundle's `SKILL.md`","type":"string"},"revision":{"description":"Opaque token of the revision returned in this response; the latest revision, or the specific one requested via `revision`","type":"string"},"skill_id":{"description":"Skill identifier","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["skill_id"],"type":"object"},"McpCallOutputItem":{"description":"One tool call executed against an external MCP server, modeled on OpenAI's mcp_call item.","properties":{"arguments":{"description":"JSON-encoded arguments the model passed.","type":"string"},"connector_id":{"description":"Present only when the item originated from a managed connector.","type":"string"},"error":{"description":"The failure string when the call failed (also returned to the model in-band); null on success, matching OpenAI's mcp_call.","type":["null","string"]},"id":{"type":"string"},"name":{"type":"string"},"output":{"description":"Tool output text; empty when the call failed.","type":"string"},"server_label":{"type":"string"},"type":{"enum":["mcp_call"],"type":"string"}},"required":["arguments","id","name","server_label","type"],"title":"McpCallOutputItem","type":"object"},"McpListToolsOutputItem":{"description":"Tools discovered on one external MCP server when the request starts. Matches OpenAI's mcp_list_tools item.","properties":{"connector_id":{"description":"Present only when the item originated from a managed connector.","type":"string"},"error":{"description":"Present only when the server's tools could not be listed. Absent on success.","type":"string"},"id":{"type":"string"},"server_label":{"type":"string"},"tools":{"items":{"$ref":"#/components/schemas/McpToolDef"},"type":"array"},"type":{"enum":["mcp_list_tools"],"type":"string"}},"required":["id","server_label","tools","type"],"title":"McpListToolsOutputItem","type":"object"},"McpTool":{"description":"Connects a user-supplied remote MCP server. Agent API discovers the server's tools when the request starts and calls them like native tools. Matches OpenAI's mcp tool. `defer_loading: true` keeps discovered definitions out of the initial model context and lets the model search, inspect, and call them as needed. `require_approval` and `connector_id` are ignored: every call auto-runs, and only bring-your-own `server_url` is honored.","properties":{"allowed_tools":{"description":"Optional allowlist of tool names. Empty exposes all discovered tools.","items":{"type":"string"},"type":"array"},"authorization":{"description":"An access token passed to the remote MCP server for authentication. Provide the raw token value. Never logged or echoed.","type":"string"},"defer_loading":{"description":"When true, keeps discovered tool definitions out of the initial model context and lets the model load relevant schemas as needed. Defaults to false.","type":"boolean"},"headers":{"additionalProperties":{"type":"string"},"description":"Extra request headers.","type":"object"},"server_label":{"description":"Unique per request, ^[a-zA-Z0-9_-]{1,64}$. Namespaces the server's tools.","type":"string"},"server_url":{"description":"HTTPS URL of the remote MCP server. Must be a Streamable HTTP MCP endpoint; the legacy SSE transport is not supported.","type":"string"},"type":{"enum":["mcp"],"type":"string"}},"required":["server_label","server_url","type"],"title":"McpTool","type":"object"},"McpToolDef":{"description":"One tool discovered on a remote MCP server.","properties":{"description":{"type":"string"},"input_schema":{"additionalProperties":true,"description":"The server's JSON Schema for the tool, passed through unmodified.","type":"object"},"name":{"type":"string"}},"required":["input_schema","name"],"title":"McpToolDef","type":"object"},"MessageOutputItem":{"properties":{"content":{"items":{"$ref":"#/components/schemas/ContentPart"},"type":"array"},"id":{"type":"string"},"role":{"$ref":"#/components/schemas/RoleType"},"status":{"$ref":"#/components/schemas/Status"},"type":{"enum":["message"],"type":"string"}},"required":["content","id","role","status","type"],"title":"MessageOutputItem","type":"object"},"Model":{"description":"Represents a model available through the Agent API.","properties":{"created":{"description":"The Unix timestamp (in seconds) when the model was created.","example":0,"type":"integer"},"id":{"description":"The model identifier in `provider/model-name` format. Use this value as the `model` parameter in Agent API requests.","example":"openai/gpt-5.5","type":"string"},"object":{"description":"The object type, which is always `model`.","enum":["model"],"example":"model","type":"string"},"owned_by":{"description":"The provider that owns the model (e.g. `openai`, `anthropic`, `google`, `perplexity`, `xai`, `z-ai`, `moonshotai`, `nvidia`).","example":"openai","type":"string"}},"required":["created","id","object","owned_by"],"type":"object"},"NamespaceTool":{"description":"A response-only namespace containing complete external tool definitions.","properties":{"description":{"type":"string"},"name":{"type":"string"},"tools":{"items":{"$ref":"#/components/schemas/NamespaceToolDef"},"type":"array"},"type":{"enum":["namespace"],"type":"string"}},"required":["description","name","tools","type"],"title":"NamespaceTool","type":"object"},"NamespaceToolDef":{"description":"One function definition discovered by hosted external-tool search.","properties":{"description":{"type":"string"},"name":{"type":"string"},"parameters":{"additionalProperties":true,"description":"The server's JSON Schema for the tool, passed through unmodified.","type":"object"},"type":{"enum":["function"],"type":"string"}},"required":["name","type"],"title":"NamespaceToolDef","type":"object"},"OutputItem":{"discriminator":{"mapping":{"fetch_url_results":"#/components/schemas/FetchUrlResultsOutputItem","finance_results":"#/components/schemas/FinanceResultsOutputItem","function_call":"#/components/schemas/FunctionCallOutputItem","mcp_call":"#/components/schemas/McpCallOutputItem","mcp_list_tools":"#/components/schemas/McpListToolsOutputItem","message":"#/components/schemas/MessageOutputItem","people_search_results":"#/components/schemas/PeopleSearchResultsOutputItem","sandbox_results":"#/components/schemas/SandboxResultsOutputItem","search_results":"#/components/schemas/SearchResultsOutputItem","tool_search_output":"#/components/schemas/ToolSearchOutputItem"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/MessageOutputItem"},{"$ref":"#/components/schemas/SearchResultsOutputItem"},{"$ref":"#/components/schemas/FetchUrlResultsOutputItem"},{"$ref":"#/components/schemas/FinanceResultsOutputItem"},{"$ref":"#/components/schemas/PeopleSearchResultsOutputItem"},{"$ref":"#/components/schemas/FunctionCallOutputItem"},{"$ref":"#/components/schemas/SandboxResultsOutputItem"},{"$ref":"#/components/schemas/McpListToolsOutputItem"},{"$ref":"#/components/schemas/McpCallOutputItem"},{"$ref":"#/components/schemas/ToolSearchOutputItem"}],"title":"OutputItem"},"OutputItemAddedEvent":{"description":"Output item added event (type: \"response.output_item.added\").\nEmitted when a new output item (message or tool call) starts.\n","properties":{"item":{"$ref":"#/components/schemas/OutputItem"},"output_index":{"format":"int64","type":"integer"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["item","output_index","sequence_number","type"],"title":"OutputItemAddedEvent","type":"object"},"OutputItemDoneEvent":{"description":"Output item done event (type: \"response.output_item.done\").\nEmitted when an output item (message or tool call) completes.\n","properties":{"item":{"$ref":"#/components/schemas/OutputItem"},"output_index":{"format":"int64","type":"integer"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["item","output_index","sequence_number","type"],"title":"OutputItemDoneEvent","type":"object"},"PeopleSearchResultsOutputItem":{"description":"Intermediate output item emitted when the people_search tool runs. Mirrors the shape of search_results: the agent's generated queries plus a list of per-person result entries.","properties":{"queries":{"description":"Search queries the agent generated for this people_search invocation.","items":{"type":"string"},"type":"array"},"results":{"description":"Per-person result entries. Shape matches SearchResult (id, url, title, snippet, source, last_updated).","items":{"$ref":"#/components/schemas/SearchResult"},"type":"array"},"type":{"enum":["people_search_results"],"type":"string"}},"required":["results","type"],"title":"PeopleSearchResultsOutputItem","type":"object"},"PeopleSearchTool":{"description":"People search tool configuration for the Agent API","properties":{"type":{"description":"Tool type identifier","enum":["people_search"],"type":"string"}},"required":["type"],"title":"PeopleSearchTool","type":"object"},"ProfileReference":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"type":"string"},"type":{"enum":["custom"],"type":"string"},"version":{"description":"Version to bind to, or \"latest\". Omitted means \"latest\".","type":"string"}},"required":["id","type"],"title":"ProfileReference","type":"object"},"ReasoningConfig":{"properties":{"effort":{"description":"How much effort the model should spend on reasoning","enum":["minimal","low","medium","high","xhigh","max"],"type":"string"}},"title":"ReasoningConfig","type":"object"},"ReasoningStartedEvent":{"description":"Reasoning started event (type: \"response.reasoning.started\").\nSignals the model has started reasoning/searching.\n","properties":{"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"thought":{"type":"string"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["sequence_number","type"],"title":"ReasoningStartedEvent","type":"object"},"ReasoningStoppedEvent":{"description":"Reasoning stopped event (type: \"response.reasoning.stopped\").\nSignals the model has finished reasoning/searching.\n","properties":{"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"thought":{"type":"string"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["sequence_number","type"],"title":"ReasoningStoppedEvent","type":"object"},"ResponseCompletedEvent":{"description":"Response event\nContains the full or partial response object.\n","properties":{"response":{"$ref":"#/components/schemas/ResponsesResponse"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["sequence_number","type"],"title":"ResponseCompletedEvent","type":"object"},"ResponseCreatedEvent":{"description":"Response created event (type: \"response.created\").\nContains the initial response object.\n","properties":{"response":{"$ref":"#/components/schemas/ResponsesResponse"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["sequence_number","type"],"title":"ResponseCreatedEvent","type":"object"},"ResponseFailedEvent":{"description":"Response failed event (type: \"response.failed\").\nContains error details when streaming fails.\n","properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["error","sequence_number","type"],"title":"ResponseFailedEvent","type":"object"},"ResponseFile":{"description":"One file shared from a response's sandbox via `share_file`.","properties":{"bytes":{"description":"File size in bytes.","format":"int64","type":"integer"},"created_at":{"description":"Unix timestamp when the file was created.","format":"int64","type":"integer"},"filename":{"description":"Name the sandbox gave the file.","type":"string"},"id":{"description":"File identifier, used to download the file; distinct from the response id.","type":"string"},"object":{"description":"Always `file`.","type":"string"}},"required":["bytes","created_at","filename","id","object"],"title":"ResponseFile","type":"object"},"ResponseFileList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ResponseFile"},"type":"array"},"object":{"description":"Always `list`.","type":"string"}},"required":["data","object"],"title":"ResponseFileList","type":"object"},"ResponseFormat":{"description":"Specifies the desired output format for the model response","properties":{"json_schema":{"$ref":"#/components/schemas/JSONSchemaFormat"},"type":{"description":"The type of response format","enum":["json_schema"],"type":"string"}},"required":["type"],"title":"ResponseFormat","type":"object"},"ResponseFormatJSONSchema":{"description":"Constrains the model output to match the provided JSON schema.","properties":{"json_schema":{"$ref":"#/components/schemas/JSONSchema"},"type":{"const":"json_schema","description":"Must be `json_schema`.","title":"Type","type":"string"}},"required":["json_schema","type"],"title":"ResponseFormatJSONSchema","type":"object"},"ResponseFormatText":{"properties":{"type":{"const":"text","description":"Must be `text`.","title":"Type","type":"string"}},"required":["type"],"title":"ResponseFormatText","type":"object"},"ResponseInProgressEvent":{"description":"Response in progress event (type: \"response.in_progress\").\nEmitted when response processing has started.\n","properties":{"response":{"$ref":"#/components/schemas/ResponsesResponse"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["sequence_number","type"],"title":"ResponseInProgressEvent","type":"object"},"ResponseStreamEvent":{"description":"SSE stream event. Discriminate by the `type` field:\n- `response.created`: Initial response object\n- `response.in_progress`: Response processing started\n- `response.completed`: Final response with output\n- `response.failed`: Error occurred\n- `response.output_item.added`: New output item started\n- `response.output_item.done`: Output item completed\n- `response.output_text.delta`: Streaming text delta\n- `response.output_text.done`: Final text content\n- `response.reasoning.started`: Reasoning phase started\n- `response.reasoning.search_queries`: Search queries issued\n- `response.reasoning.search_results`: Search results received\n- `response.reasoning.fetch_url_queries`: URL fetch queries issued\n- `response.reasoning.fetch_url_results`: URL fetch results received\n- `response.reasoning.stopped`: Reasoning phase complete\n","discriminator":{"mapping":{"response.completed":"#/components/schemas/ResponseCompletedEvent","response.created":"#/components/schemas/ResponseCreatedEvent","response.failed":"#/components/schemas/ResponseFailedEvent","response.in_progress":"#/components/schemas/ResponseInProgressEvent","response.output_item.added":"#/components/schemas/OutputItemAddedEvent","response.output_item.done":"#/components/schemas/OutputItemDoneEvent","response.output_text.delta":"#/components/schemas/TextDeltaEvent","response.output_text.done":"#/components/schemas/TextDoneEvent","response.reasoning.fetch_url_queries":"#/components/schemas/FetchUrlQueriesEvent","response.reasoning.fetch_url_results":"#/components/schemas/FetchUrlResultsEvent","response.reasoning.search_queries":"#/components/schemas/SearchQueriesEvent","response.reasoning.search_results":"#/components/schemas/SearchResultsEvent","response.reasoning.started":"#/components/schemas/ReasoningStartedEvent","response.reasoning.stopped":"#/components/schemas/ReasoningStoppedEvent"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/ResponseCreatedEvent"},{"$ref":"#/components/schemas/ResponseInProgressEvent"},{"$ref":"#/components/schemas/ResponseCompletedEvent"},{"$ref":"#/components/schemas/ResponseFailedEvent"},{"$ref":"#/components/schemas/OutputItemAddedEvent"},{"$ref":"#/components/schemas/OutputItemDoneEvent"},{"$ref":"#/components/schemas/TextDeltaEvent"},{"$ref":"#/components/schemas/TextDoneEvent"},{"$ref":"#/components/schemas/ReasoningStartedEvent"},{"$ref":"#/components/schemas/SearchQueriesEvent"},{"$ref":"#/components/schemas/SearchResultsEvent"},{"$ref":"#/components/schemas/FetchUrlQueriesEvent"},{"$ref":"#/components/schemas/FetchUrlResultsEvent"},{"$ref":"#/components/schemas/ReasoningStoppedEvent"}],"title":"ResponseStreamEvent"},"ResponsesCost":{"description":"Cost breakdown for a Responses API request","properties":{"cache_creation_cost":{"description":"Cost for cache creation in USD","format":"double","type":"number"},"cache_read_cost":{"description":"Cost for cache reads in USD","format":"double","type":"number"},"currency":{"$ref":"#/components/schemas/Currency","description":"Currency of the cost values"},"input_cost":{"description":"Cost for input tokens in USD","format":"double","type":"number"},"output_cost":{"description":"Cost for output tokens in USD","format":"double","type":"number"},"tool_calls_cost":{"description":"Cost for tool call invocations in USD","format":"double","type":"number"},"total_cost":{"description":"Total cost for the request in USD","format":"double","type":"number"}},"required":["currency","input_cost","output_cost","total_cost"],"title":"ResponsesCost","type":"object"},"ResponsesObjectType":{"description":"Object type in API responses","enum":["response"],"title":"ResponsesObjectType","type":"string"},"ResponsesRequest":{"properties":{"background":{"description":"Run the response asynchronously. With `stream: false`, the request returns immediately with `status: \"queued\"`; poll `GET /v1/responses/{id}` until the response reaches a terminal status. Background runs are durable, so you can also stream them and reconnect after a drop.","type":"boolean"},"input":{"$ref":"#/components/schemas/Input"},"instructions":{"description":"System instructions for the model","type":"string"},"language_preference":{"description":"ISO 639-1 language code for response language","type":"string"},"max_output_tokens":{"description":"Maximum tokens to generate. This is a shared optional Agent API request parameter, but it is required when using anthropic/* models. If omitted for an Anthropic model, the API returns HTTP 400 with: validation failed: max_output_tokens is required when using Anthropic models.","format":"int32","minimum":1,"type":"integer"},"max_steps":{"description":"Maximum number of research loop steps.\nIf provided, overrides the preset's max_steps value. For requests that specify model or models without a preset, the default is 1.\nSet max_steps to at least 3 when using finance_search with a direct model so the agent has enough steps to initialize and run the tool.\nMust be >= 1 if specified. Maximum allowed is 100.\n","format":"int32","maximum":100,"minimum":1,"type":"integer"},"model":{"description":"Model ID in provider/model format (e.g., \"openai/gpt-5.6-terra\", \"anthropic/claude-sonnet-4-6\").\nIf models is also provided, models takes precedence.\nRequired if neither models nor preset is provided.\n","type":"string"},"models":{"description":"Model fallback chain. Each model is in provider/model format.\nModels are tried in order until one succeeds.\nMax 5 models allowed. If set, takes precedence over single model field.\nThe response.model will reflect the model that actually succeeded.\n","items":{"type":"string"},"maxItems":5,"minItems":1,"type":"array"},"preset":{"description":"Preset configuration name (e.g., \"fast\", \"low\", \"medium\", \"high\", \"xhigh\").\nPre-configured model with system prompt and search parameters.\nRequired if model is not provided.\n","type":"string"},"previous_response_id":{"description":"OpenAI-compatible previous response id for multi-turn response chains. When set, the new response continues from the completed prior response's saved state. The prior response must belong to the same account and have completed.","type":"string"},"profile":{"allOf":[{"$ref":"#/components/schemas/ProfileReference"}],"description":"Saved, versioned configuration to run with. The version is resolved when the request is admitted. Cannot be combined with preset."},"reasoning":{"$ref":"#/components/schemas/ReasoningConfig"},"response_format":{"$ref":"#/components/schemas/ResponseFormat"},"skills":{"description":"Built-in, request-scoped inline, and organization-owned custom skills available to the model. Skill metadata is disclosed to the model up front; full instructions are loaded on demand through the load_skill tool. Selecting any skill enables the sandbox tool for the request. Requests with skills run on the durable backend and skills are not echoed back on Response objects.","items":{"$ref":"#/components/schemas/Skill"},"maxItems":16,"type":"array"},"store":{"description":"OpenAI-compatible storage toggle. When false, the response is hidden from later retrieve calls, and the echoed response reports `store: false`. It can still be used as a `previous_response_id` continuation source.","type":"boolean"},"stream":{"description":"If true, returns SSE stream instead of JSON","type":"boolean"},"temperature":{"description":"OpenAI-compatible sampling temperature forwarded to generation.","format":"double","maximum":2,"minimum":0,"type":"number"},"tools":{"description":"Tools available to the model","items":{"$ref":"#/components/schemas/Tool"},"type":"array"},"top_p":{"description":"OpenAI-compatible nucleus sampling parameter forwarded to generation.","format":"double","maximum":1,"minimum":0,"type":"number"}},"required":["input"],"title":"ResponsesRequest","type":"object"},"ResponsesResponse":{"description":"Non-streaming response returned when stream is false","properties":{"created_at":{"description":"Unix timestamp when the response was created","format":"int64","type":"integer"},"error":{"$ref":"#/components/schemas/ErrorInfo","description":"Error details if the response failed"},"id":{"description":"Unique identifier for the response","type":"string"},"model":{"description":"Model used for generation","type":"string"},"object":{"$ref":"#/components/schemas/ResponsesObjectType","description":"Object type identifier"},"output":{"description":"Array of output items (messages, search results, tool calls)","items":{"$ref":"#/components/schemas/OutputItem"},"type":"array"},"status":{"$ref":"#/components/schemas/Status","description":"Status of the response"},"usage":{"$ref":"#/components/schemas/ResponsesUsage","description":"Token usage and cost information"}},"required":["created_at","id","model","object","output","status"],"title":"ResponsesResponse","type":"object"},"ResponsesUsage":{"description":"Token usage and cost information for a Responses API request","properties":{"cost":{"$ref":"#/components/schemas/ResponsesCost","description":"Cost breakdown for the request"},"input_tokens":{"description":"Number of input tokens used","format":"int64","type":"integer"},"input_tokens_details":{"properties":{"cache_creation_input_tokens":{"description":"Tokens used for cache creation","format":"int64","type":"integer"},"cache_read_input_tokens":{"description":"Tokens read from cache","format":"int64","type":"integer"}},"type":"object"},"output_tokens":{"description":"Number of output tokens generated","format":"int64","type":"integer"},"tool_calls_details":{"additionalProperties":{"$ref":"#/components/schemas/ToolCallDetails"},"description":"Details about tool call invocations","type":"object"},"total_tokens":{"description":"Total tokens used (input + output)","format":"int64","type":"integer"}},"required":["input_tokens","output_tokens","total_tokens"],"title":"ResponsesUsage","type":"object"},"RoleType":{"description":"Role in a message","enum":["assistant"],"title":"RoleType","type":"string"},"SandboxResultsOutputItem":{"description":"Result of a sandbox tool invocation. Contains the executed code and its output.","properties":{"code":{"description":"The code that was executed inside the sandbox.","type":"string"},"duration_ms":{"description":"Wall-clock duration of the sandbox execution, in milliseconds.","format":"int64","type":"integer"},"exit_code":{"description":"Process exit code. Non-zero indicates a runtime error.","format":"int32","type":"integer"},"status":{"description":"Execution status. One of `completed`, `timed_out`, `failed`.","enum":["completed","timed_out","failed"],"type":"string"},"stderr":{"description":"Standard error captured from the sandbox execution.","type":"string"},"stdout":{"description":"Standard output captured from the sandbox execution.","type":"string"},"type":{"enum":["sandbox_results"],"type":"string"}},"required":["status","type"],"title":"SandboxResultsOutputItem","type":"object"},"SandboxTool":{"description":"Sandbox tool configuration for the Responses API. Executes code in an isolated container during an Agent API request.","properties":{"type":{"description":"Tool type identifier","enum":["sandbox"],"type":"string"}},"required":["type"],"title":"SandboxTool","type":"object"},"SearchDomainFilter":{"properties":{"search_domain_filter":{"description":"Limit search results to specific domains (max 20)","items":{"maxLength":253,"type":"string"},"maxItems":20,"type":"array"}},"title":"SearchDomainFilter","type":"object"},"SearchQueriesEvent":{"description":"Search queries event (type: \"response.reasoning.search_queries\").\nContains search queries being executed.\n","properties":{"queries":{"items":{"type":"string"},"type":"array"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"thought":{"type":"string"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["queries","sequence_number","type"],"title":"SearchQueriesEvent","type":"object"},"SearchRecencyFilter":{"description":"Time-based recency filter for search results","enum":["hour","day","week","month","year"],"title":"SearchRecencyFilter","type":"string"},"SearchResult":{"description":"A single search result used in LLM responses","properties":{"date":{"description":"Publication date of the result","type":"string"},"id":{"description":"Unique numeric identifier for the result","format":"int64","type":"integer"},"last_updated":{"description":"Date the result was last updated","type":"string"},"snippet":{"description":"Text snippet from the search result","type":"string"},"source":{"$ref":"#/components/schemas/SearchSource","description":"Source type of the result"},"title":{"description":"Title of the search result page","type":"string"},"url":{"description":"URL of the search result page","type":"string"}},"required":["id","snippet","title","url"],"title":"SearchResult","type":"object"},"SearchResultsEvent":{"description":"Search results event (type: \"response.reasoning.search_results\").\nContains search results returned.\n","properties":{"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"thought":{"type":"string"},"type":{"$ref":"#/components/schemas/EventType"},"usage":{"$ref":"#/components/schemas/ResponsesUsage"}},"required":["results","sequence_number","type"],"title":"SearchResultsEvent","type":"object"},"SearchResultsOutputItem":{"properties":{"queries":{"items":{"type":"string"},"type":"array"},"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array"},"type":{"enum":["search_results"],"type":"string"}},"required":["results","type"],"title":"SearchResultsOutputItem","type":"object"},"SearchSource":{"description":"Source of search results","enum":["web"],"title":"SearchSource","type":"string"},"Skill":{"discriminator":{"mapping":{"builtin":"#/components/schemas/BuiltinSkill","custom":"#/components/schemas/CustomSkill","inline":"#/components/schemas/InlineSkill"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/BuiltinSkill"},{"$ref":"#/components/schemas/InlineSkill"},{"$ref":"#/components/schemas/CustomSkill"}],"title":"Skill"},"SkillDownload":{"properties":{"download_url":{"description":"Short-lived URL to download the zip bundle","type":"string"},"name":{"description":"Skill name at this revision","type":"string"},"revision":{"description":"Opaque token of the downloaded revision","type":"string"}},"required":["download_url"],"type":"object"},"SkillList":{"properties":{"next_page_token":{"description":"Opaque token for the next page; omitted on the last page","type":"string"},"skills":{"items":{"$ref":"#/components/schemas/SkillSummary"},"type":"array"}},"required":["skills"],"type":"object"},"SkillRevision":{"properties":{"created_at":{"format":"date-time","type":"string"},"name":{"description":"Skill name at this revision","type":"string"},"revision":{"description":"Opaque revision token","type":"string"}},"required":["revision"],"type":"object"},"SkillRevisionList":{"properties":{"next_page_token":{"description":"Opaque token for the next page; omitted on the last page","type":"string"},"revisions":{"items":{"$ref":"#/components/schemas/SkillRevision"},"type":"array"}},"required":["revisions"],"type":"object"},"SkillSummary":{"properties":{"created_at":{"format":"date-time","type":"string"},"name":{"description":"Skill name, read from the bundle's `SKILL.md`","type":"string"},"revision":{"description":"Opaque revision token of the skill; pass as expected_revision to update or delete","type":"string"},"skill_id":{"description":"Skill identifier","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["skill_id"],"type":"object"},"Status":{"description":"Status of a response or output item","enum":["completed","failed","incomplete","in_progress","queued","cancelled"],"title":"Status","type":"string"},"TextDeltaEvent":{"description":"Text delta event (type: \"response.output_text.delta\").\nContains incremental text content.\n","properties":{"content_index":{"format":"int64","type":"integer"},"delta":{"type":"string"},"item_id":{"type":"string"},"output_index":{"format":"int64","type":"integer"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["content_index","delta","item_id","output_index","sequence_number","type"],"title":"TextDeltaEvent","type":"object"},"TextDoneEvent":{"description":"Text done event (type: \"response.output_text.done\").\nContains the final text content.\n","properties":{"content_index":{"format":"int64","type":"integer"},"item_id":{"type":"string"},"output_index":{"format":"int64","type":"integer"},"sequence_number":{"description":"Monotonically increasing sequence number for event ordering","format":"int64","type":"integer"},"text":{"type":"string"},"type":{"$ref":"#/components/schemas/EventType"}},"required":["content_index","item_id","output_index","sequence_number","text","type"],"title":"TextDoneEvent","type":"object"},"Tool":{"discriminator":{"mapping":{"connector":"#/components/schemas/ConnectorTool","fetch_url":"#/components/schemas/FetchUrlTool","finance_search":"#/components/schemas/FinanceSearchTool","function":"#/components/schemas/FunctionTool","mcp":"#/components/schemas/McpTool","people_search":"#/components/schemas/PeopleSearchTool","sandbox":"#/components/schemas/SandboxTool","web_search":"#/components/schemas/WebSearchTool"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/WebSearchTool"},{"$ref":"#/components/schemas/FinanceSearchTool"},{"$ref":"#/components/schemas/PeopleSearchTool"},{"$ref":"#/components/schemas/FetchUrlTool"},{"$ref":"#/components/schemas/FunctionTool"},{"$ref":"#/components/schemas/SandboxTool"},{"$ref":"#/components/schemas/McpTool"},{"$ref":"#/components/schemas/ConnectorTool"}],"title":"Tool"},"ToolCallDetails":{"description":"Details about a tool call invocation","properties":{"invocation":{"description":"Number of times this tool was invoked","format":"int64","type":"integer"}},"title":"ToolCallDetails","type":"object"},"ToolSearchOutputItem":{"description":"Complete public definitions matched by one hosted external-tool search.","properties":{"arguments":{"description":"Exact argument text authored by the model for hosted search.","type":"string"},"call_id":{"description":"Always null for hosted search.","type":["null","string"]},"execution":{"description":"Execution location. Currently `server`. Clients must tolerate unknown values.","type":"string"},"id":{"type":"string"},"status":{"description":"Current execution status. Known values are `in_progress`, `completed`, and `incomplete`. Clients must tolerate unknown values.","type":"string"},"tools":{"items":{"$ref":"#/components/schemas/NamespaceTool"},"type":"array"},"type":{"enum":["tool_search_output"],"type":"string"}},"required":["call_id","execution","id","status","tools","type"],"title":"ToolSearchOutputItem","type":"object"},"ToolUserLocation":{"description":"User's geographic location for search personalization","properties":{"city":{"description":"City name","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code","type":"string"},"latitude":{"description":"Latitude coordinate","format":"double","type":"number"},"longitude":{"description":"Longitude coordinate","format":"double","type":"number"},"region":{"description":"State or region name","type":"string"}},"title":"ToolUserLocation","type":"object"},"URL":{"properties":{"url":{"title":"Url","type":"string"}},"required":["url"],"title":"URL","type":"object"},"UrlContent":{"description":"Content fetched from a URL","properties":{"snippet":{"description":"The fetched content snippet","type":"string"},"title":{"description":"The title of the page","type":"string"},"url":{"description":"The URL from which content was fetched","type":"string"}},"required":["snippet","title","url"],"title":"UrlContent","type":"object"},"UsageInfo":{"description":"Token usage and cost information for a request","properties":{"citation_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of tokens used for citations","title":"Citation Tokens"},"completion_tokens":{"description":"Number of tokens in the completion/output","title":"Completion Tokens","type":"integer"},"cost":{"$ref":"#/components/schemas/Cost","description":"Cost breakdown for the request"},"num_search_queries":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of search queries executed","title":"Num Search Queries"},"prompt_tokens":{"description":"Number of tokens in the prompt/input","title":"Prompt Tokens","type":"integer"},"reasoning_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of tokens used for reasoning","title":"Reasoning Tokens"},"search_context_size":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Size of search context used","title":"Search Context Size"},"total_tokens":{"description":"Total tokens used (prompt + completion)","title":"Total Tokens","type":"integer"}},"required":["completion_tokens","cost","prompt_tokens","total_tokens"],"title":"UsageInfo","type":"object"},"UserLocation":{"description":"User's geographic location for search personalization","properties":{"city":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"City name","title":"City"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 3166-1 alpha-2 country code","title":"Country"},"latitude":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Latitude coordinate","title":"Latitude"},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Longitude coordinate","title":"Longitude"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"State or region name","title":"Region"}},"title":"UserLocation","type":"object"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"VideoURL":{"properties":{"frame_interval":{"anyOf":[{"type":"string"},{"type":"integer"}],"default":25,"title":"Frame Interval"},"url":{"title":"Url","type":"string"}},"required":["url"],"title":"VideoURL","type":"object"},"WebSearchFilters":{"allOf":[{"$ref":"#/components/schemas/SearchDomainFilter"},{"$ref":"#/components/schemas/DateFilters"}],"title":"WebSearchFilters"},"WebSearchOptions":{"description":"Configuration options for web search behavior","properties":{"image_results_enhanced_relevance":{"default":false,"description":"When true, applies enhanced relevance filtering to image results","title":"Image Results Enhanced Relevance","type":"boolean"},"search_context_size":{"default":"low","description":"Amount of search context to include (low, medium, or high)","enum":["low","medium","high"],"title":"Search Context Size","type":"string"},"search_type":{"anyOf":[{"enum":["fast","pro","auto"],"type":"string"},{"type":"null"}],"description":"Search type (fast for speed, pro for quality, auto to let the model decide)","title":"Search Type"},"user_location":{"anyOf":[{"$ref":"#/components/schemas/UserLocation"},{"type":"null"}]}},"title":"WebSearchOptions","type":"object"},"WebSearchTool":{"description":"Web search tool configuration for the Responses API","properties":{"filters":{"$ref":"#/components/schemas/WebSearchFilters","description":"Domain and date filters for search results"},"max_results":{"description":"Upper bound on the number of search results collected per call. Must be between 1 and 50; values outside that range are rejected with a 400 error.","format":"int32","maximum":50,"minimum":1,"type":"integer"},"max_tokens":{"description":"Maximum total tokens for search context","format":"int32","type":"integer"},"max_tokens_per_page":{"description":"Maximum tokens to extract per search result page","format":"int32","type":"integer"},"search_context_size":{"description":"Named search context budget. Explicit max_tokens / max_tokens_per_page budgets override it.","enum":["low","medium","high"],"type":"string"},"search_type":{"description":"Search type for this tool. `web` uses standard web search. `fast` uses the lower-latency Fast Search path, billed at $1.00 per 1,000 invocations plus model tokens. When omitted, inherits the preset's search type if configured; otherwise uses `web`.","enum":["web","fast"],"type":"string"},"type":{"description":"Tool type identifier","enum":["web_search"],"type":"string"},"user_location":{"$ref":"#/components/schemas/ToolUserLocation","description":"User's location for search personalization"}},"required":["type"],"title":"WebSearchTool","type":"object"}},"securitySchemes":{"HTTPBearer":{"scheme":"bearer","type":"http"}}},"info":{"description":"Perplexity AI API","title":"Perplexity AI API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/search":{"post":{"description":"Search the web and retrieve relevant web page contents.","operationId":"search_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiSearchRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiSearchResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"HTTPBearer":[]}],"summary":"Search the Web","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/search\");\nrequest.Content = new StringContent(\"{\\\"country\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_results\\\":10,\\\"max_tokens\\\":0,\\\"max_tokens_per_page\\\":0,\\\"query\\\":\\\"string\\\",\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_context_size\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_recency_filter\\\":\\\"day\\\",\\\"search_type\\\":\\\"web\\\"}\", Encoding.UTF8, \"application/json\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/search' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"country\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_results\":10,\"max_tokens\":0,\"max_tokens_per_page\":0,\"query\":\"string\",\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_context_size\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_recency_filter\":\"day\",\"search_type\":\"web\"}'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tbody := strings.NewReader(`{\"country\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_results\":10,\"max_tokens\":0,\"max_tokens_per_page\":0,\"query\":\"string\",\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_context_size\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_recency_filter\":\"day\",\"search_type\":\"web\"}`)\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/search\", body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/search\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"country\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_results\\\":10,\\\"max_tokens\\\":0,\\\"max_tokens_per_page\\\":0,\\\"query\\\":\\\"string\\\",\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_context_size\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_recency_filter\\\":\\\"day\\\",\\\"search_type\\\":\\\"web\\\"}\"))\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/search', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\"country\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_results\":10,\"max_tokens\":0,\"max_tokens_per_page\":0,\"query\":\"string\",\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_context_size\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_recency_filter\":\"day\",\"search_type\":\"web\"}),\n});\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/search', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: \"{\\\"country\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_results\\\":10,\\\"max_tokens\\\":0,\\\"max_tokens_per_page\\\":0,\\\"query\\\":\\\"string\\\",\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_context_size\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_recency_filter\\\":\\\"day\\\",\\\"search_type\\\":\\\"web\\\"}\" });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/search\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($request, CURLOPT_POSTFIELDS, \"{\\\"country\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_results\\\":10,\\\"max_tokens\\\":0,\\\"max_tokens_per_page\\\":0,\\\"query\\\":\\\"string\\\",\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_context_size\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_recency_filter\\\":\\\"day\\\",\\\"search_type\\\":\\\"web\\\"}\");\ncurl_setopt($request, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.perplexity.ai/search\",\n    headers={\"Content-Type\": \"application/json\"},\n    data='{\"country\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_results\":10,\"max_tokens\":0,\"max_tokens_per_page\":0,\"query\":\"string\",\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_context_size\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_recency_filter\":\"day\",\"search_type\":\"web\"}',\n)\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/search\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", true, true, uri)\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"country\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_results\\\":10,\\\"max_tokens\\\":0,\\\"max_tokens_per_page\\\":0,\\\"query\\\":\\\"string\\\",\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_context_size\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_recency_filter\\\":\\\"day\\\",\\\"search_type\\\":\\\"web\\\"}\"\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/agent":{"post":{"description":"Generate a response for the provided input with optional web search and reasoning.","operationId":"createAgent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesResponse"}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/ResponseStreamEvent"}}},"description":"Successful response. Content type depends on `stream` parameter:\n- `stream: false` (default): `application/json` with Response\n- `stream: true`: `text/event-stream` with SSE events\n"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"type":"object"}}},"description":"Invalid request. Includes an unresolvable `previous_response_id`: the referenced response does not exist, belongs to a different account, has failed, or is still running."}},"security":[{"HTTPBearer":[]}],"summary":"Create Agent Response","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/v1/agent\");\nrequest.Content = new StringContent(\"{\\\"background\\\":true,\\\"input\\\":\\\"string\\\",\\\"instructions\\\":\\\"string\\\",\\\"language_preference\\\":\\\"string\\\",\\\"max_output_tokens\\\":0,\\\"max_steps\\\":0,\\\"model\\\":\\\"string\\\",\\\"models\\\":[\\\"string\\\"],\\\"preset\\\":\\\"string\\\",\\\"previous_response_id\\\":\\\"string\\\",\\\"profile\\\":{\\\"id\\\":\\\"string\\\",\\\"type\\\":\\\"custom\\\",\\\"version\\\":\\\"string\\\"},\\\"reasoning\\\":{\\\"effort\\\":\\\"high\\\"},\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"string\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"skills\\\":[{\\\"name\\\":\\\"office\\\",\\\"type\\\":\\\"builtin\\\"}],\\\"store\\\":true,\\\"stream\\\":true,\\\"temperature\\\":0,\\\"tools\\\":[{\\\"allowed_tools\\\":[\\\"string\\\"],\\\"id\\\":\\\"string\\\",\\\"server_description\\\":\\\"string\\\",\\\"server_label\\\":\\\"string\\\",\\\"type\\\":\\\"connector\\\"}],\\\"top_p\\\":0}\", Encoding.UTF8, \"application/json\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/v1/agent' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"background\":true,\"input\":\"string\",\"instructions\":\"string\",\"language_preference\":\"string\",\"max_output_tokens\":0,\"max_steps\":0,\"model\":\"string\",\"models\":[\"string\"],\"preset\":\"string\",\"previous_response_id\":\"string\",\"profile\":{\"id\":\"string\",\"type\":\"custom\",\"version\":\"string\"},\"reasoning\":{\"effort\":\"high\"},\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"string\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"skills\":[{\"name\":\"office\",\"type\":\"builtin\"}],\"store\":true,\"stream\":true,\"temperature\":0,\"tools\":[{\"allowed_tools\":[\"string\"],\"id\":\"string\",\"server_description\":\"string\",\"server_label\":\"string\",\"type\":\"connector\"}],\"top_p\":0}'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tbody := strings.NewReader(`{\"background\":true,\"input\":\"string\",\"instructions\":\"string\",\"language_preference\":\"string\",\"max_output_tokens\":0,\"max_steps\":0,\"model\":\"string\",\"models\":[\"string\"],\"preset\":\"string\",\"previous_response_id\":\"string\",\"profile\":{\"id\":\"string\",\"type\":\"custom\",\"version\":\"string\"},\"reasoning\":{\"effort\":\"high\"},\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"string\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"skills\":[{\"name\":\"office\",\"type\":\"builtin\"}],\"store\":true,\"stream\":true,\"temperature\":0,\"tools\":[{\"allowed_tools\":[\"string\"],\"id\":\"string\",\"server_description\":\"string\",\"server_label\":\"string\",\"type\":\"connector\"}],\"top_p\":0}`)\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/v1/agent\", body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/agent\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"background\\\":true,\\\"input\\\":\\\"string\\\",\\\"instructions\\\":\\\"string\\\",\\\"language_preference\\\":\\\"string\\\",\\\"max_output_tokens\\\":0,\\\"max_steps\\\":0,\\\"model\\\":\\\"string\\\",\\\"models\\\":[\\\"string\\\"],\\\"preset\\\":\\\"string\\\",\\\"previous_response_id\\\":\\\"string\\\",\\\"profile\\\":{\\\"id\\\":\\\"string\\\",\\\"type\\\":\\\"custom\\\",\\\"version\\\":\\\"string\\\"},\\\"reasoning\\\":{\\\"effort\\\":\\\"high\\\"},\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"string\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"skills\\\":[{\\\"name\\\":\\\"office\\\",\\\"type\\\":\\\"builtin\\\"}],\\\"store\\\":true,\\\"stream\\\":true,\\\"temperature\\\":0,\\\"tools\\\":[{\\\"allowed_tools\\\":[\\\"string\\\"],\\\"id\\\":\\\"string\\\",\\\"server_description\\\":\\\"string\\\",\\\"server_label\\\":\\\"string\\\",\\\"type\\\":\\\"connector\\\"}],\\\"top_p\\\":0}\"))\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/agent', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\"background\":true,\"input\":\"string\",\"instructions\":\"string\",\"language_preference\":\"string\",\"max_output_tokens\":0,\"max_steps\":0,\"model\":\"string\",\"models\":[\"string\"],\"preset\":\"string\",\"previous_response_id\":\"string\",\"profile\":{\"id\":\"string\",\"type\":\"custom\",\"version\":\"string\"},\"reasoning\":{\"effort\":\"high\"},\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"string\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"skills\":[{\"name\":\"office\",\"type\":\"builtin\"}],\"store\":true,\"stream\":true,\"temperature\":0,\"tools\":[{\"allowed_tools\":[\"string\"],\"id\":\"string\",\"server_description\":\"string\",\"server_label\":\"string\",\"type\":\"connector\"}],\"top_p\":0}),\n});\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/agent', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: \"{\\\"background\\\":true,\\\"input\\\":\\\"string\\\",\\\"instructions\\\":\\\"string\\\",\\\"language_preference\\\":\\\"string\\\",\\\"max_output_tokens\\\":0,\\\"max_steps\\\":0,\\\"model\\\":\\\"string\\\",\\\"models\\\":[\\\"string\\\"],\\\"preset\\\":\\\"string\\\",\\\"previous_response_id\\\":\\\"string\\\",\\\"profile\\\":{\\\"id\\\":\\\"string\\\",\\\"type\\\":\\\"custom\\\",\\\"version\\\":\\\"string\\\"},\\\"reasoning\\\":{\\\"effort\\\":\\\"high\\\"},\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"string\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"skills\\\":[{\\\"name\\\":\\\"office\\\",\\\"type\\\":\\\"builtin\\\"}],\\\"store\\\":true,\\\"stream\\\":true,\\\"temperature\\\":0,\\\"tools\\\":[{\\\"allowed_tools\\\":[\\\"string\\\"],\\\"id\\\":\\\"string\\\",\\\"server_description\\\":\\\"string\\\",\\\"server_label\\\":\\\"string\\\",\\\"type\\\":\\\"connector\\\"}],\\\"top_p\\\":0}\" });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/agent\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($request, CURLOPT_POSTFIELDS, \"{\\\"background\\\":true,\\\"input\\\":\\\"string\\\",\\\"instructions\\\":\\\"string\\\",\\\"language_preference\\\":\\\"string\\\",\\\"max_output_tokens\\\":0,\\\"max_steps\\\":0,\\\"model\\\":\\\"string\\\",\\\"models\\\":[\\\"string\\\"],\\\"preset\\\":\\\"string\\\",\\\"previous_response_id\\\":\\\"string\\\",\\\"profile\\\":{\\\"id\\\":\\\"string\\\",\\\"type\\\":\\\"custom\\\",\\\"version\\\":\\\"string\\\"},\\\"reasoning\\\":{\\\"effort\\\":\\\"high\\\"},\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"string\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"skills\\\":[{\\\"name\\\":\\\"office\\\",\\\"type\\\":\\\"builtin\\\"}],\\\"store\\\":true,\\\"stream\\\":true,\\\"temperature\\\":0,\\\"tools\\\":[{\\\"allowed_tools\\\":[\\\"string\\\"],\\\"id\\\":\\\"string\\\",\\\"server_description\\\":\\\"string\\\",\\\"server_label\\\":\\\"string\\\",\\\"type\\\":\\\"connector\\\"}],\\\"top_p\\\":0}\");\ncurl_setopt($request, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.perplexity.ai/v1/agent\",\n    headers={\"Content-Type\": \"application/json\"},\n    data='{\"background\":true,\"input\":\"string\",\"instructions\":\"string\",\"language_preference\":\"string\",\"max_output_tokens\":0,\"max_steps\":0,\"model\":\"string\",\"models\":[\"string\"],\"preset\":\"string\",\"previous_response_id\":\"string\",\"profile\":{\"id\":\"string\",\"type\":\"custom\",\"version\":\"string\"},\"reasoning\":{\"effort\":\"high\"},\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"string\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"skills\":[{\"name\":\"office\",\"type\":\"builtin\"}],\"store\":true,\"stream\":true,\"temperature\":0,\"tools\":[{\"allowed_tools\":[\"string\"],\"id\":\"string\",\"server_description\":\"string\",\"server_label\":\"string\",\"type\":\"connector\"}],\"top_p\":0}',\n)\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/agent\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", true, true, uri)\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"background\\\":true,\\\"input\\\":\\\"string\\\",\\\"instructions\\\":\\\"string\\\",\\\"language_preference\\\":\\\"string\\\",\\\"max_output_tokens\\\":0,\\\"max_steps\\\":0,\\\"model\\\":\\\"string\\\",\\\"models\\\":[\\\"string\\\"],\\\"preset\\\":\\\"string\\\",\\\"previous_response_id\\\":\\\"string\\\",\\\"profile\\\":{\\\"id\\\":\\\"string\\\",\\\"type\\\":\\\"custom\\\",\\\"version\\\":\\\"string\\\"},\\\"reasoning\\\":{\\\"effort\\\":\\\"high\\\"},\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"string\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"skills\\\":[{\\\"name\\\":\\\"office\\\",\\\"type\\\":\\\"builtin\\\"}],\\\"store\\\":true,\\\"stream\\\":true,\\\"temperature\\\":0,\\\"tools\\\":[{\\\"allowed_tools\\\":[\\\"string\\\"],\\\"id\\\":\\\"string\\\",\\\"server_description\\\":\\\"string\\\",\\\"server_label\\\":\\\"string\\\",\\\"type\\\":\\\"connector\\\"}],\\\"top_p\\\":0}\"\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/agent/{id}":{"get":{"description":"Retrieve a response created earlier. Returns a JSON snapshot of the response. Only responses created with `store` omitted or `true` can be retrieved; `store: false` responses return a 404.","operationId":"retrieveAgent","parameters":[{"description":"Response id (`resp_<...>`)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesResponse"}}},"description":"JSON snapshot of the response."},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"type":"object"}}},"description":"Unknown id, or the response belongs to a different account, or the response was created with `store: false`."}},"security":[{"HTTPBearer":[]}],"summary":"Retrieve Agent Response","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/agent/string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/agent/string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/agent/string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/agent/string\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/agent/string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/agent/string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/agent/string\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/agent/{id}/cancel":{"post":{"description":"Requests cancellation of response `{id}`. Acts on durable state, so it works for background runs that outlive the client connection. Cancellation is asynchronous: a `200` acknowledges the request (`status: cancelling`) and the run stops shortly after - poll `GET /v1/agent/{id}` for its terminal status. Cancelling a run that is already terminal returns `400`. Ownership is enforced server side; a cross-tenant or unknown id surfaces as `404`.","operationId":"cancelAgentResponse","parameters":[{"description":"Response id (`resp_<...>`)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"response_id":{"description":"The response id (`resp_<...>`).","type":"string"},"status":{"description":"Always `cancelling` - the cancel was accepted and the run stops asynchronously. An already-terminal run returns `400` instead, so no terminal status appears here.","enum":["cancelling"],"type":"string"}},"required":["response_id","status"],"type":"object"}}},"description":"The cancel request was accepted; the run is being cancelled."},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"type":"object"}}},"description":"The response is already terminal, or the request is invalid."},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"type":"object"}}},"description":"Unknown id, or the response belongs to a different account."}},"security":[{"HTTPBearer":[]}],"summary":"Cancel Agent Response","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/v1/agent/string/cancel\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/v1/agent/string/cancel'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/v1/agent/string/cancel\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/agent/string/cancel\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string/cancel', { method: 'POST' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string/cancel', { method: 'POST' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/agent/string/cancel\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"POST\", \"https://api.perplexity.ai/v1/agent/string/cancel\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/agent/string/cancel\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/agent/{id}/files":{"get":{"description":"List the files a response produced in the sandbox and delivered with the `share_file` tool. Scoped to the authenticated account, which only ever sees its own files. File content is not returned inline; download it with the file content endpoint.","operationId":"listAgentFiles","parameters":[{"description":"Response id (`resp_<...>`)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseFileList"}}},"description":"The list of files delivered from the response's sandbox."},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"type":"object"}}},"description":"Unknown id, or the response belongs to a different account."}},"security":[{"HTTPBearer":[]}],"summary":"List Agent Response Files","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/agent/string/files\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/agent/string/files'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/agent/string/files\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/agent/string/files\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string/files', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string/files', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/agent/string/files\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/agent/string/files\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/agent/string/files\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/agent/{id}/files/{file_id}/content":{"get":{"description":"Download the raw bytes of a file the response delivered with the `share_file` tool. The `file_id` comes from the file list endpoint and is distinct from the response `id`. The response streams raw bytes, not JSON, with a `Content-Type` matching the file and a `Content-Disposition: attachment` header carrying the original filename.","operationId":"downloadAgentFile","parameters":[{"description":"Response id (`resp_<...>`)","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"File id from the file list endpoint","in":"path","name":"file_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The raw file bytes."},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"type":"object"}}},"description":"Unknown response id or file id, or the response belongs to a different account."}},"security":[{"HTTPBearer":[]}],"summary":"Download Agent Response File","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/agent/string/files/string/content\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/agent/string/files/string/content'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/agent/string/files/string/content\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/agent/string/files/string/content\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string/files/string/content', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/agent/string/files/string/content', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/agent/string/files/string/content\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/agent/string/files/string/content\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/agent/string/files/string/content\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/analytics/computer/usage":{"get":{"description":"Returns your organization's Perplexity usage analytics as a bucketed time series for a single dataset. Requires an organization analytics API key, generated by an org admin from Settings → Organization → Computer in the Perplexity web app. Only complete UTC grid buckets are returned: start_time snaps down to its bucket, and the in-progress bucket is never included. Datasets differ in what they count: credits for credit_usage, queries for query_volume, distinct active members for daily_active_users, and thread counts for the rest. Buckets of daily_active_users are not additive — a member active on several days is counted once per day, so summing them is not the window's active-member count.","operationId":"getComputerUsageAnalytics","parameters":[{"description":"The dataset to query. query_volume and daily_active_users are daily organization-level datasets: they reject bucket_width=1h and user_email.","in":"query","name":"dataset","required":true,"schema":{"enum":["credit_usage","connectors","artifacts","skills","spaces","workflows","task_durations","query_volume","daily_active_users"],"type":"string"}},{"description":"Window start in unix seconds (UTC), inclusive. Snapped down to the bucket grid, so the first bucket can include usage from before this time.","in":"query","name":"start_time","required":true,"schema":{"minimum":0,"type":"integer"}},{"description":"Window end in unix seconds (UTC), exclusive. Defaults to now; future values are capped at now. The window may span at most 90 days.","in":"query","name":"end_time","required":false,"schema":{"minimum":0,"type":"integer"}},{"description":"Bucket size. Buckets align to the UTC grid. Not accepted as 1h for query_volume or daily_active_users, which are stored at day grain.","in":"query","name":"bucket_width","required":false,"schema":{"default":"1d","enum":["1d","1h"],"type":"string"}},{"description":"Buckets per page. 1d: default 7, max 31. 1h: default 24, max 168.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Opaque pagination cursor from a previous response's next_page. Valid only with the same query parameters it was issued for.","in":"query","name":"page","required":false,"schema":{"type":"string"}},{"description":"Restrict results to a single member of your organization. Emails that don't match a current member return a generic 400. Not available for query_volume or daily_active_users, which are aggregated per organization; use the v2 endpoint for per-member query volume.","in":"query","name":"user_email","required":false,"schema":{"format":"email","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"categories":["Model","Credit Source"],"data":[{"by_categories":{"Credit Source":[{"category":"paid","count":250},{"category":"promo","count":80}],"Model":[{"category":"claude-opus-4-8","count":210},{"category":"claude-sonnet-4-6","count":120}]},"count":350,"end_time":1746144000,"start_time":1746057600}],"has_more":false,"next_page":null},"schema":{"$ref":"#/components/schemas/ComputerUsageResponse"}}},"description":"Bucketed usage for the requested window. Buckets without data carry count 0; the analytics store syncs periodically, so a zero in a recent bucket can mean the data hasn't synced yet."},"400":{"content":{"application/json":{"example":{"error":{"code":400,"message":"start_time must be before end_time.","type":"invalid_request"}},"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"Invalid parameters (type: bad_request) or semantically invalid request (type: invalid_request) — e.g. start_time after end_time, a window over 90 days, a misused pagination cursor, or a user_email that doesn't match a member of the organization."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"Missing or invalid API key (type: unauthorized)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"The Analytics API is not enabled for this organization (type: feature_disabled)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"Rate limit exceeded (type: request_rate_limit_exceeded). Limits apply per organization across all of its keys."}},"security":[{"HTTPBearer":[]}],"summary":"Usage Analytics","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/analytics/computer/usage?bucket_width=1d&dataset=artifacts&end_time=0&limit=0&page=string&start_time=0&user_email=user%40example.com\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/async/sonar":{"get":{"description":"Retrieve a list of all asynchronous chat completion requests for a given user.","operationId":"list_async_chat_completions_async_chat_completions_get","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAsyncApiChatCompletionsResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"HTTPBearer":[]}],"summary":"List Async Chat Completions","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/async/sonar\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/async/sonar'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/async/sonar\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/async/sonar\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/async/sonar', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/async/sonar', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/async/sonar\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/async/sonar\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/async/sonar\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]},"post":{"description":"Submit an asynchronous chat completion request.","operationId":"create_async_chat_completions_async_chat_completions_post","requestBody":{"content":{"application/json":{"example":{"request":{"messages":[{"content":"<string>","role":"<string>"}],"model":"sonar-deep-research"}},"schema":{"$ref":"#/components/schemas/AsyncApiChatCompletionsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncApiChatCompletionsResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"HTTPBearer":[]}],"summary":"Create Async Chat Completion","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/v1/async/sonar\");\nrequest.Content = new StringContent(\"{\\\"idempotency_key\\\":\\\"string\\\",\\\"request\\\":{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}}\", Encoding.UTF8, \"application/json\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/v1/async/sonar' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"idempotency_key\":\"string\",\"request\":{\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}}'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tbody := strings.NewReader(`{\"idempotency_key\":\"string\",\"request\":{\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}}`)\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/v1/async/sonar\", body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/async/sonar\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"idempotency_key\\\":\\\"string\\\",\\\"request\\\":{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}}\"))\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/async/sonar', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\"idempotency_key\":\"string\",\"request\":{\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}}),\n});\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/async/sonar', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: \"{\\\"idempotency_key\\\":\\\"string\\\",\\\"request\\\":{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}}\" });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/async/sonar\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($request, CURLOPT_POSTFIELDS, \"{\\\"idempotency_key\\\":\\\"string\\\",\\\"request\\\":{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}}\");\ncurl_setopt($request, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.perplexity.ai/v1/async/sonar\",\n    headers={\"Content-Type\": \"application/json\"},\n    data='{\"idempotency_key\":\"string\",\"request\":{\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}}',\n)\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/async/sonar\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", true, true, uri)\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"idempotency_key\\\":\\\"string\\\",\\\"request\\\":{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}}\"\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/async/sonar/{api_request}":{"get":{"description":"Retrieve the response for a given asynchronous chat completion request.","operationId":"get_async_chat_completion_response_async_chat_completions__api_request__get","parameters":[{"in":"path","name":"api_request","required":true,"schema":{"title":"Api Request","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncApiChatCompletionsResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"HTTPBearer":[]}],"summary":"Get Async Chat Completion","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/async/sonar/string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/async/sonar/string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/async/sonar/string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/async/sonar/string\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/async/sonar/string', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/async/sonar/string', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/async/sonar/string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/async/sonar/string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/async/sonar/string\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/contextualizedembeddings":{"post":{"description":"Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.","operationId":"contextualized_embeddings_v1_contextualizedembeddings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextualizedEmbeddingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextualizedEmbeddingsResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"HTTPBearer":[]}],"summary":"Create Contextualized Embeddings","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/v1/contextualizedembeddings\");\nrequest.Content = new StringContent(\"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":[[\\\"string\\\"]],\\\"model\\\":\\\"pplx-embed-context-v1-0.6b\\\"}\", Encoding.UTF8, \"application/json\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/v1/contextualizedembeddings' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":[[\"string\"]],\"model\":\"pplx-embed-context-v1-0.6b\"}'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tbody := strings.NewReader(`{\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":[[\"string\"]],\"model\":\"pplx-embed-context-v1-0.6b\"}`)\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/v1/contextualizedembeddings\", body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/contextualizedembeddings\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":[[\\\"string\\\"]],\\\"model\\\":\\\"pplx-embed-context-v1-0.6b\\\"}\"))\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/contextualizedembeddings', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":[[\"string\"]],\"model\":\"pplx-embed-context-v1-0.6b\"}),\n});\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/contextualizedembeddings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: \"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":[[\\\"string\\\"]],\\\"model\\\":\\\"pplx-embed-context-v1-0.6b\\\"}\" });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/contextualizedembeddings\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($request, CURLOPT_POSTFIELDS, \"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":[[\\\"string\\\"]],\\\"model\\\":\\\"pplx-embed-context-v1-0.6b\\\"}\");\ncurl_setopt($request, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.perplexity.ai/v1/contextualizedembeddings\",\n    headers={\"Content-Type\": \"application/json\"},\n    data='{\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":[[\"string\"]],\"model\":\"pplx-embed-context-v1-0.6b\"}',\n)\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/contextualizedembeddings\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", true, true, uri)\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":[[\\\"string\\\"]],\\\"model\\\":\\\"pplx-embed-context-v1-0.6b\\\"}\"\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/embeddings":{"post":{"description":"Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.","operationId":"embeddings_v1_embeddings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"HTTPBearer":[]}],"summary":"Create Embeddings","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/v1/embeddings\");\nrequest.Content = new StringContent(\"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":\\\"string\\\",\\\"model\\\":\\\"pplx-embed-v1-0.6b\\\"}\", Encoding.UTF8, \"application/json\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/v1/embeddings' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":\"string\",\"model\":\"pplx-embed-v1-0.6b\"}'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tbody := strings.NewReader(`{\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":\"string\",\"model\":\"pplx-embed-v1-0.6b\"}`)\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/v1/embeddings\", body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/embeddings\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":\\\"string\\\",\\\"model\\\":\\\"pplx-embed-v1-0.6b\\\"}\"))\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/embeddings', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":\"string\",\"model\":\"pplx-embed-v1-0.6b\"}),\n});\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/embeddings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: \"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":\\\"string\\\",\\\"model\\\":\\\"pplx-embed-v1-0.6b\\\"}\" });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/embeddings\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($request, CURLOPT_POSTFIELDS, \"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":\\\"string\\\",\\\"model\\\":\\\"pplx-embed-v1-0.6b\\\"}\");\ncurl_setopt($request, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.perplexity.ai/v1/embeddings\",\n    headers={\"Content-Type\": \"application/json\"},\n    data='{\"dimensions\":0,\"encoding_format\":\"base64_int8\",\"input\":\"string\",\"model\":\"pplx-embed-v1-0.6b\"}',\n)\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/embeddings\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", true, true, uri)\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"dimensions\\\":0,\\\"encoding_format\\\":\\\"base64_int8\\\",\\\"input\\\":\\\"string\\\",\\\"model\\\":\\\"pplx-embed-v1-0.6b\\\"}\"\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/models":{"get":{"description":"List the models available for the Agent API. Returns model identifiers that can be used with the `POST /v1/agent` endpoint. The response follows the OpenAI List Models format for compatibility with third-party tools.","operationId":"listModels","responses":{"200":{"content":{"application/json":{"example":{"data":[{"created":0,"id":"anthropic/claude-opus-5","object":"model","owned_by":"anthropic"},{"created":0,"id":"anthropic/claude-opus-5-5","object":"model","owned_by":"anthropic"},{"created":0,"id":"anthropic/claude-opus-4-8","object":"model","owned_by":"anthropic"},{"created":0,"id":"anthropic/claude-sonnet-5","object":"model","owned_by":"anthropic"},{"created":0,"id":"anthropic/claude-fable-5","object":"model","owned_by":"anthropic"},{"created":0,"id":"anthropic/claude-sonnet-4-6","object":"model","owned_by":"anthropic"},{"created":0,"id":"openai/gpt-6-sol","object":"model","owned_by":"openai"},{"created":0,"id":"openai/gpt-6-luna","object":"model","owned_by":"openai"},{"created":0,"id":"openai/gpt-5.6-sol","object":"model","owned_by":"openai"},{"created":0,"id":"openai/gpt-5.6-terra","object":"model","owned_by":"openai"},{"created":0,"id":"openai/gpt-5.6-luna","object":"model","owned_by":"openai"},{"created":0,"id":"openai/gpt-5.5","object":"model","owned_by":"openai"},{"created":0,"id":"google/gemini-3.1-flash-lite","object":"model","owned_by":"google"},{"created":0,"id":"google/gemini-3.5-flash","object":"model","owned_by":"google"},{"created":0,"id":"google/gemini-3.5-flash-lite","object":"model","owned_by":"google"},{"created":0,"id":"google/gemini-3.6-flash","object":"model","owned_by":"google"},{"created":0,"id":"google/gemini-3.7-flash","object":"model","owned_by":"google"},{"created":0,"id":"google/gemini-3.8-flash","object":"model","owned_by":"google"},{"created":0,"id":"xai/grok-4.7","object":"model","owned_by":"xai"},{"created":0,"id":"xai/grok-4.6","object":"model","owned_by":"xai"},{"created":0,"id":"xai/grok-4.5","object":"model","owned_by":"xai"},{"created":0,"id":"xai/grok-4.3","object":"model","owned_by":"xai"},{"created":0,"id":"xai/grok-4.20-reasoning","object":"model","owned_by":"xai"},{"created":0,"id":"xai/grok-4.20-non-reasoning","object":"model","owned_by":"xai"},{"created":0,"id":"xai/grok-4.20-multi-agent","object":"model","owned_by":"xai"},{"created":0,"id":"perplexity/glm-5.3","object":"model","owned_by":"perplexity"},{"created":0,"id":"perplexity/glm-5.3-flash","object":"model","owned_by":"perplexity"},{"created":0,"id":"perplexity/kimi-k3","object":"model","owned_by":"moonshotai"},{"created":0,"id":"perplexity/sonar","object":"model","owned_by":"perplexity"}],"object":"list"},"schema":{"$ref":"#/components/schemas/ListModelsResponse"}}},"description":"Successful response with the list of available models."}},"security":[],"summary":"List Models","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/models\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/models'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/models\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/models\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/models', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/models', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/models\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/models\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/models\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/skills":{"get":{"description":"Lists the skills in your Project, newest first.","operationId":"listSkills","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/PageToken"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillList"}}},"description":"Available skills"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid request"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Rate limit exceeded"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill service unavailable"}},"security":[{"HTTPBearer":[]}],"summary":"List skills","tags":["Skills"],"x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/skills?limit=0&page_token=string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/skills?limit=0&page_token=string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/skills?limit=0&page_token=string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/skills?limit=0&page_token=string\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/skills?limit=0&page_token=string', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/skills?limit=0&page_token=string', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/skills?limit=0&page_token=string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/skills?limit=0&page_token=string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/skills?limit=0&page_token=string\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]},"post":{"description":"Creates a skill from a zip bundle. The bundle must contain a `SKILL.md`\nthat provides the skill name and description; those fields are read from\nthe bundle, not from the request.\n","operationId":"createSkill","requestBody":{"$ref":"#/components/requestBodies/SkillBundle"},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedSkill"}}},"description":"The created skill"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid request or bundle"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill limit reached for this Project; delete a skill to create another"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Bundle exceeds the size limit"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Rate limit or upload concurrency limit exceeded"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill service unavailable"}},"security":[{"HTTPBearer":[]}],"summary":"Create a skill","tags":["Skills"],"x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/v1/skills\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/v1/skills'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/v1/skills\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/skills\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/skills', { method: 'POST' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/skills', { method: 'POST' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/skills\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"POST\", \"https://api.perplexity.ai/v1/skills\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/skills\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/skills/{skill_id}":{"delete":{"description":"Deletes a skill. Pass the current revision as `expected_revision`; the\ndelete fails with `409` if the skill has a newer revision, so a delete\nnever races a concurrent update.\n","operationId":"deleteSkill","parameters":[{"$ref":"#/components/parameters/SkillId"},{"$ref":"#/components/parameters/ExpectedRevisionRequired"}],"responses":{"204":{"description":"Skill deleted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Revision conflict; the skill moved past expected_revision"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Rate limit exceeded"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill service unavailable"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a skill","tags":["Skills"],"x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Delete, \"https://api.perplexity.ai/v1/skills/string?expected_revision=string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X DELETE 'https://api.perplexity.ai/v1/skills/string?expected_revision=string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"DELETE\", \"https://api.perplexity.ai/v1/skills/string?expected_revision=string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/skills/string?expected_revision=string\"))\n    .method(\"DELETE\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string?expected_revision=string', { method: 'DELETE' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string?expected_revision=string', { method: 'DELETE' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/skills/string?expected_revision=string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"DELETE\", \"https://api.perplexity.ai/v1/skills/string?expected_revision=string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/skills/string?expected_revision=string\")\nrequest = Net::HTTPGenericRequest.new(\"DELETE\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]},"get":{"description":"Returns a skill. Without `revision`, returns the active revision.","operationId":"getSkill","parameters":[{"$ref":"#/components/parameters/SkillId"},{"$ref":"#/components/parameters/Revision"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedSkill"}}},"description":"The skill"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill or revision not found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Rate limit exceeded"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill service unavailable"}},"security":[{"HTTPBearer":[]}],"summary":"Get a skill","tags":["Skills"],"x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/skills/string?revision=string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/skills/string?revision=string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/skills/string?revision=string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/skills/string?revision=string\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string?revision=string', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string?revision=string', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/skills/string?revision=string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/skills/string?revision=string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/skills/string?revision=string\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]},"put":{"description":"Uploads a new zip bundle as a new revision of an existing skill. Pass the\nrevision you expect to replace as the required `expected_revision`; the\nrequest fails with `409` if the skill has already moved past it, so the\nupdate cannot race a concurrent write. Name and description are re-read\nfrom the new bundle.\n","operationId":"updateSkill","parameters":[{"$ref":"#/components/parameters/SkillId"},{"$ref":"#/components/parameters/ExpectedRevisionRequired"}],"requestBody":{"$ref":"#/components/requestBodies/SkillBundle"},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedSkill"}}},"description":"The updated skill"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid request or bundle"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Revision conflict; the skill moved past expected_revision"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Bundle exceeds the size limit"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Rate limit or upload concurrency limit exceeded"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill service unavailable"}},"security":[{"HTTPBearer":[]}],"summary":"Add a skill revision","tags":["Skills"],"x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Put, \"https://api.perplexity.ai/v1/skills/string?expected_revision=string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X PUT 'https://api.perplexity.ai/v1/skills/string?expected_revision=string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"PUT\", \"https://api.perplexity.ai/v1/skills/string?expected_revision=string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/skills/string?expected_revision=string\"))\n    .method(\"PUT\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string?expected_revision=string', { method: 'PUT' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string?expected_revision=string', { method: 'PUT' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/skills/string?expected_revision=string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"PUT\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"PUT\", \"https://api.perplexity.ai/v1/skills/string?expected_revision=string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/skills/string?expected_revision=string\")\nrequest = Net::HTTPGenericRequest.new(\"PUT\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/skills/{skill_id}/download":{"get":{"description":"Returns a short-lived URL to download the skill bundle as a zip. Without\n`revision`, returns the active revision.\n","operationId":"downloadSkill","parameters":[{"$ref":"#/components/parameters/SkillId"},{"$ref":"#/components/parameters/Revision"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillDownload"}}},"description":"The skill bundle download"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill or revision not found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Rate limit exceeded"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill service unavailable"}},"security":[{"HTTPBearer":[]}],"summary":"Get a skill download URL","tags":["Skills"],"x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/skills/string/download?revision=string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/skills/string/download?revision=string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/skills/string/download?revision=string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/skills/string/download?revision=string\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string/download?revision=string', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string/download?revision=string', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/skills/string/download?revision=string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/skills/string/download?revision=string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/skills/string/download?revision=string\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/skills/{skill_id}/revisions":{"get":{"description":"Lists the revisions of a skill, newest first.","operationId":"listSkillRevisions","parameters":[{"$ref":"#/components/parameters/SkillId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/PageToken"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRevisionList"}}},"description":"The skill revisions"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Invalid request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill not found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Rate limit exceeded"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Skill service unavailable"}},"security":[{"HTTPBearer":[]}],"summary":"List skill revisions","tags":["Skills"],"x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/skills/string/revisions?limit=0&page_token=string\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v1/sonar":{"post":{"description":"Generate a chat completion response for the given conversation.","operationId":"chat_completions_chat_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiChatCompletionsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"HTTPBearer":[]}],"summary":"Create Chat Completion","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Post, \"https://api.perplexity.ai/v1/sonar\");\nrequest.Content = new StringContent(\"{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}\", Encoding.UTF8, \"application/json\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X POST 'https://api.perplexity.ai/v1/sonar' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tbody := strings.NewReader(`{\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}`)\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", \"https://api.perplexity.ai/v1/sonar\", body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v1/sonar\"))\n    .method(\"POST\", HttpRequest.BodyPublishers.noBody())\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}\"))\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v1/sonar', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}),\n});\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v1/sonar', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: \"{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}\" });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v1/sonar\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($request, CURLOPT_POSTFIELDS, \"{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}\");\ncurl_setopt($request, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.perplexity.ai/v1/sonar\",\n    headers={\"Content-Type\": \"application/json\"},\n    data='{\"disable_search\":true,\"enable_search_classifier\":true,\"image_domain_filter\":[\"string\"],\"image_format_filter\":[\"string\"],\"language_preference\":\"string\",\"last_updated_after_filter\":\"string\",\"last_updated_before_filter\":\"string\",\"max_tokens\":0,\"messages\":[{\"content\":\"string\",\"role\":\"assistant\"}],\"model\":\"sonar\",\"reasoning_effort\":\"high\",\"response_format\":{\"json_schema\":{\"description\":\"string\",\"name\":\"schema\",\"schema\":{\"additionalProp1\":null},\"strict\":true},\"type\":\"json_schema\"},\"return_images\":true,\"return_related_questions\":true,\"search_after_date_filter\":\"string\",\"search_before_date_filter\":\"string\",\"search_domain_filter\":[\"string\"],\"search_language_filter\":[\"string\"],\"search_mode\":\"academic\",\"search_recency_filter\":\"day\",\"stop\":\"string\",\"stream\":false,\"stream_mode\":\"full\",\"temperature\":0,\"top_p\":0,\"web_search_options\":{\"image_results_enhanced_relevance\":false,\"search_context_size\":\"low\",\"search_type\":\"auto\",\"user_location\":null}}',\n)\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v1/sonar\")\nrequest = Net::HTTPGenericRequest.new(\"POST\", true, true, uri)\nrequest['Content-Type'] = 'application/json'\nrequest.body = \"{\\\"disable_search\\\":true,\\\"enable_search_classifier\\\":true,\\\"image_domain_filter\\\":[\\\"string\\\"],\\\"image_format_filter\\\":[\\\"string\\\"],\\\"language_preference\\\":\\\"string\\\",\\\"last_updated_after_filter\\\":\\\"string\\\",\\\"last_updated_before_filter\\\":\\\"string\\\",\\\"max_tokens\\\":0,\\\"messages\\\":[{\\\"content\\\":\\\"string\\\",\\\"role\\\":\\\"assistant\\\"}],\\\"model\\\":\\\"sonar\\\",\\\"reasoning_effort\\\":\\\"high\\\",\\\"response_format\\\":{\\\"json_schema\\\":{\\\"description\\\":\\\"string\\\",\\\"name\\\":\\\"schema\\\",\\\"schema\\\":{\\\"additionalProp1\\\":null},\\\"strict\\\":true},\\\"type\\\":\\\"json_schema\\\"},\\\"return_images\\\":true,\\\"return_related_questions\\\":true,\\\"search_after_date_filter\\\":\\\"string\\\",\\\"search_before_date_filter\\\":\\\"string\\\",\\\"search_domain_filter\\\":[\\\"string\\\"],\\\"search_language_filter\\\":[\\\"string\\\"],\\\"search_mode\\\":\\\"academic\\\",\\\"search_recency_filter\\\":\\\"day\\\",\\\"stop\\\":\\\"string\\\",\\\"stream\\\":false,\\\"stream_mode\\\":\\\"full\\\",\\\"temperature\\\":0,\\\"top_p\\\":0,\\\"web_search_options\\\":{\\\"image_results_enhanced_relevance\\\":false,\\\"search_context_size\\\":\\\"low\\\",\\\"search_type\\\":\\\"auto\\\",\\\"user_location\\\":null}}\"\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}},"/v2/analytics/computer/usage":{"get":{"description":"Returns your organization's Perplexity usage broken down per member, as daily buckets. Each day lists one row per member with usage that day, keyed by email. credit_usage carries the same Model and Credit Source breakdown as v1; query_volume carries Feature, Project and Comet. Uses the same organization analytics API key as v1. Only complete UTC days are returned; the in-progress day is never included.","operationId":"getComputerUsageAnalyticsV2","parameters":[{"description":"The dataset to query. query_volume at this grain carries Feature, Project and Comet breakdowns, but not Model or Model Family.","in":"query","name":"dataset","required":true,"schema":{"enum":["credit_usage","query_volume"],"type":"string"}},{"description":"The dimension to group each day's usage by. user_email is currently the only supported value.","in":"query","name":"group_by","required":true,"schema":{"enum":["user_email"],"type":"string"}},{"description":"Window start in unix seconds (UTC), inclusive. Snapped down to the day grid, so the first day can include usage from before this time.","in":"query","name":"start_time","required":true,"schema":{"minimum":0,"type":"integer"}},{"description":"Window end in unix seconds (UTC), exclusive. Defaults to now; future values are capped at now. The window may span at most 90 days.","in":"query","name":"end_time","required":false,"schema":{"minimum":0,"type":"integer"}},{"description":"Member rows per page. Default 50, max 100. A page can span multiple days.","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Opaque pagination cursor from a previous response's next_page. Valid only with the same query parameters it was issued for.","in":"query","name":"page","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"categories":["Model","Credit Source"],"data":[{"end_time":1746144000,"results":[{"by_categories":{"Credit Source":[{"category":"paid","count":900}],"Model":[{"category":"claude-opus-4-8","count":900}]},"count":900,"user_email":"alice@example.com"},{"by_categories":{"Credit Source":[{"category":"promo","count":500}],"Model":[{"category":"claude-sonnet-4-6","count":500}]},"count":500,"user_email":"bob@example.com"}],"start_time":1746057600}],"has_more":true,"next_page":"eyJwayI6ICJPUkcjLi4uIn0="},"schema":{"$ref":"#/components/schemas/ComputerUsageV2Response"}}},"description":"Per-member daily usage for the requested window. Days with no attributable usage are omitted; the analytics store syncs periodically, so recent days may not yet be present."},"400":{"content":{"application/json":{"example":{"error":{"code":400,"message":"start_time must be before end_time.","type":"invalid_request"}},"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"Invalid parameters (type: bad_request) — e.g. a dataset or group_by outside the accepted values — or a semantically invalid request (type: invalid_request), e.g. start_time after end_time, a window over 90 days, or a misused pagination cursor."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"Missing or invalid API key (type: unauthorized)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"The Analytics API is not enabled for this organization (type: feature_disabled)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsErrorResponse"}}},"description":"Rate limit exceeded (type: request_rate_limit_exceeded). Limits apply per organization across all of its keys."}},"security":[{"HTTPBearer":[]}],"summary":"Usage Analytics per Member","x-codeSamples":[{"lang":"csharp","source":"using var client = new HttpClient();\nusing var request = new HttpRequestMessage(HttpMethod.Get, \"https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0\");\nusing var response = await client.SendAsync(request);"},{"lang":"curl","source":"curl -X GET 'https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0'"},{"lang":"go","source":"package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", \"https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n}"},{"lang":"java","source":"var request = HttpRequest.newBuilder(URI.create(\"https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0\"))\n    .method(\"GET\", HttpRequest.BodyPublishers.noBody())\n    .build();\nvar response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"},{"lang":"javascript-fetch","source":"const response = await fetch('https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0', { method: 'GET' });\nconst data = await response.json();"},{"lang":"node","source":"const response = await fetch('https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0', { method: 'GET' });\nconsole.log(await response.json());"},{"lang":"php","source":"<?php\n$request = curl_init(\"https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0\");\ncurl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n$response = curl_exec($request);\ncurl_close($request);"},{"lang":"python","source":"import requests\n\nresponse = requests.request(\"GET\", \"https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0\")\nprint(response.json())"},{"lang":"ruby","source":"require 'net/http'\n\nuri = URI(\"https://api.perplexity.ai/v2/analytics/computer/usage?dataset=credit_usage&end_time=0&group_by=user_email&limit=0&page=string&start_time=0\")\nrequest = Net::HTTPGenericRequest.new(\"GET\", false, true, uri)\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }"}]}}},"servers":[{"description":"Perplexity AI API","url":"https://api.perplexity.ai"}]}