> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vellum.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vellum.ai/_mcp/server.

# Search

POST https://predict.vellum.ai/v1/search
Content-Type: application/json

Perform a search against a document index.

Reference: https://docs.vellum.ai/developers/client-sdk/document-indexes/search

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Body (application/json)

This endpoint expects a SearchRequestBodyRequest.

- `query` (string, required) — The query to search for.
- `index_id` (string, optional, nullable) — The ID of the index to search against. Must provide either this, index_name or document_index.
- `index_name` (string, optional, nullable) — The name of the index to search against. Must provide either this, index_id or document_index.
- `options` (SearchRequestOptionsRequest, optional, nullable) — Configuration options for the search.
- `document_index` (string, optional, nullable) — Either the index name or index ID to search against. Must provide either this, index_id or index_name.

## Response

### 200

- `results` (list of SearchResult, required) — The results of the search. Each result represents a chunk that matches the search query.

## Errors

### 400 Bad Request Error

- `detail` (string, required) — Details about why the request failed.

### 404 Not Found Error

- `detail` (string, required) — Details about why the request failed.

### 500 Internal Server Error

- `detail` (string, required) — Details about why the request failed.

## Types

### SearchRequestOptionsRequest

- `limit` (integer, optional, nullable, default: 10) — The maximum number of results to return.
- `weights` (SearchWeightsRequest, optional, nullable) — The weights to use for the search. Must add up to 1.0.
- `result_merging` (SearchResultMergingRequest, optional, nullable) — The configuration for merging results.
- `filters` (SearchFiltersRequest, optional, nullable) — The filters to apply to the search.

### SearchResult

- `text` (string, required) — The text of the chunk that matched the search query.
- `score` (double, required) — A score representing how well the chunk matches the search query.
- `keywords` (list of string, required)
- `document` (SearchResultDocument, required) — The document that contains the chunk that matched the search query.
- `meta` (SearchResultMeta, optional, nullable) — Additional information about the search result.

### SearchWeightsRequest

- `semantic_similarity` (double, optional, default: 0.8) — The relative weight to give to semantic similarity
- `keywords` (double, optional, default: 0.2) — The relative weight to give to keywords

### SearchResultMergingRequest

- `enabled` (boolean, optional, default: true) — Whether to enable merging results

### SearchFiltersRequest

- `external_ids` (list of string, optional, nullable) — The document external IDs to filter by
- `metadata` (MetadataFiltersRequest, optional, nullable) — The metadata filters to apply to the search

### SearchResultDocument

- `label` (string, required) — The human-readable name for the document.
- `id` (string, optional, nullable) — The ID of the document.
- `external_id` (string, optional, nullable) — The unique ID of the document as represented in an external system and specified when it was originally uploaded.
- `metadata` (map from string to any, optional, nullable) — A previously supplied JSON object containing metadata that can be filtered on when searching.

### SearchResultMeta

- `source` (SearchResultMetaSource, optional, nullable)

### MetadataFiltersRequest

- MetadataFilterConfigRequest: MetadataFilterConfigRequest
- VellumValueLogicalExpressionRequest: VellumValueLogicalExpressionRequest

### SearchResultMetaSource

- PDF: PdfSearchResultMetaSource

### MetadataFilterConfigRequest

A deprecated pattern for filtering on metadata. Please use MetadataFilters instead.

- `combinator` (enum, optional, nullable) — * `and` - AND * `or` - OR
  - Allowed values: `and`, `or`
- `negated` (boolean, optional, nullable)
- `rules` (list of MetadataFilterRuleRequest, optional, nullable)
- `field` (string, optional, nullable)
- `operator` (enum, optional, nullable) — * `=` - EQUALS * `!=` - DOES\_NOT\_EQUAL * `<` - LESS\_THAN * `>` - GREATER\_THAN * `<=` - LESS\_THAN\_OR\_EQUAL\_TO * `>=` - GREATER\_THAN\_OR\_EQUAL\_TO * `contains` - CONTAINS * `beginsWith` - BEGINS\_WITH * `endsWith` - ENDS\_WITH * `doesNotContain` - DOES\_NOT\_CONTAIN * `doesNotBeginWith` - DOES\_NOT\_BEGIN\_WITH * `doesNotEndWith` - DOES\_NOT\_END\_WITH * `null` - NULL * `notNull` - NOT\_NULL * `in` - IN * `notIn` - NOT\_IN * `between` - BETWEEN * `notBetween` - NOT\_BETWEEN * `concat` - CONCAT * `+` - ADD * `-` - MINUS * `blank` - BLANK * `notBlank` - NOT\_BLANK * `coalesce` - COALESCE * `accessField` - ACCESS\_FIELD * `parseJson` - PARSE\_JSON * `and` - AND * `or` - OR * `isError` - IS\_ERROR * `length` - LENGTH
  - Allowed values: `=`, `!=`, `<`, `>`, `<=`, `>=`, `contains`, `beginsWith`, `endsWith`, `doesNotContain`, `doesNotBeginWith`, `doesNotEndWith`, `null`, `notNull`, `in`, `notIn`, `between`, `notBetween`, `concat`, `+`, `-`, `blank`, `notBlank`, `coalesce`, `accessField`, `parseJson`, `and`, `or`, `isError`, `length`
- `value` (string, optional, nullable)

### VellumValueLogicalExpressionRequest

- LOGICAL_CONDITION: VellumValueLogicalConditionRequest
- LOGICAL_CONDITION_GROUP: VellumValueLogicalConditionGroupRequest

### PdfSearchResultMetaSource

The source of a search result from a PDF document.

- `document_type` (enum, required)
  - Allowed values: `PDF`
- `start_page_num` (integer, required, nullable) — The 1-indexed page number where the chunk starts in the document. Only available for supported chunking strategies and document types.
- `end_page_num` (integer, required, nullable) — The 1-indexed page number where the chunk ends in the document. Only available for supported chunking strategies and document types.

### MetadataFilterRuleRequest

- `combinator` (enum, optional, nullable) — * `and` - AND * `or` - OR
  - Allowed values: `and`, `or`
- `negated` (boolean, optional, nullable)
- `rules` (list of MetadataFilterRuleRequest, optional, nullable)
- `field` (string, optional, nullable)
- `operator` (enum, optional, nullable) — * `=` - EQUALS * `!=` - DOES\_NOT\_EQUAL * `<` - LESS\_THAN * `>` - GREATER\_THAN * `<=` - LESS\_THAN\_OR\_EQUAL\_TO * `>=` - GREATER\_THAN\_OR\_EQUAL\_TO * `contains` - CONTAINS * `beginsWith` - BEGINS\_WITH * `endsWith` - ENDS\_WITH * `doesNotContain` - DOES\_NOT\_CONTAIN * `doesNotBeginWith` - DOES\_NOT\_BEGIN\_WITH * `doesNotEndWith` - DOES\_NOT\_END\_WITH * `null` - NULL * `notNull` - NOT\_NULL * `in` - IN * `notIn` - NOT\_IN * `between` - BETWEEN * `notBetween` - NOT\_BETWEEN * `concat` - CONCAT * `+` - ADD * `-` - MINUS * `blank` - BLANK * `notBlank` - NOT\_BLANK * `coalesce` - COALESCE * `accessField` - ACCESS\_FIELD * `parseJson` - PARSE\_JSON * `and` - AND * `or` - OR * `isError` - IS\_ERROR * `length` - LENGTH
  - Allowed values: `=`, `!=`, `<`, `>`, `<=`, `>=`, `contains`, `beginsWith`, `endsWith`, `doesNotContain`, `doesNotBeginWith`, `doesNotEndWith`, `null`, `notNull`, `in`, `notIn`, `between`, `notBetween`, `concat`, `+`, `-`, `blank`, `notBlank`, `coalesce`, `accessField`, `parseJson`, `and`, `or`, `isError`, `length`
- `value` (string, optional, nullable)

### VellumValueLogicalConditionRequest

A basic condition comparing two Vellum values.

- `type` (enum, required)
  - Allowed values: `LOGICAL_CONDITION`
- `lhs_variable` (VellumValueRequest, required)
- `operator` (enum, required) — * `=` - EQUALS * `!=` - DOES\_NOT\_EQUAL * `<` - LESS\_THAN * `>` - GREATER\_THAN * `<=` - LESS\_THAN\_OR\_EQUAL\_TO * `>=` - GREATER\_THAN\_OR\_EQUAL\_TO * `contains` - CONTAINS * `beginsWith` - BEGINS\_WITH * `endsWith` - ENDS\_WITH * `doesNotContain` - DOES\_NOT\_CONTAIN * `doesNotBeginWith` - DOES\_NOT\_BEGIN\_WITH * `doesNotEndWith` - DOES\_NOT\_END\_WITH * `null` - NULL * `notNull` - NOT\_NULL * `in` - IN * `notIn` - NOT\_IN * `between` - BETWEEN * `notBetween` - NOT\_BETWEEN * `concat` - CONCAT * `+` - ADD * `-` - MINUS * `blank` - BLANK * `notBlank` - NOT\_BLANK * `coalesce` - COALESCE * `accessField` - ACCESS\_FIELD * `parseJson` - PARSE\_JSON * `and` - AND * `or` - OR * `isError` - IS\_ERROR * `length` - LENGTH
  - Allowed values: `=`, `!=`, `<`, `>`, `<=`, `>=`, `contains`, `beginsWith`, `endsWith`, `doesNotContain`, `doesNotBeginWith`, `doesNotEndWith`, `null`, `notNull`, `in`, `notIn`, `between`, `notBetween`, `concat`, `+`, `-`, `blank`, `notBlank`, `coalesce`, `accessField`, `parseJson`, `and`, `or`, `isError`, `length`
- `rhs_variable` (VellumValueRequest, required)

### VellumValueLogicalConditionGroupRequest

A higher-order condition that combines one or more basic conditions or other higher-order conditions.

- `type` (enum, required)
  - Allowed values: `LOGICAL_CONDITION_GROUP`
- `conditions` (list of VellumValueLogicalExpressionRequest, required)
- `combinator` (enum, required) — * `OR` - OR * `AND` - AND
  - Allowed values: `OR`, `AND`
- `negated` (boolean, required)

### VellumValueRequest

- STRING: StringVellumValueRequest
- NUMBER: NumberVellumValueRequest
- JSON: JsonVellumValueRequest
- AUDIO: AudioVellumValueRequest
- VIDEO: VideoVellumValueRequest
- IMAGE: ImageVellumValueRequest
- DOCUMENT: DocumentVellumValueRequest
- FUNCTION_CALL: FunctionCallVellumValueRequest
- ERROR: ErrorVellumValueRequest
- ARRAY: ArrayVellumValueRequest
- CHAT_HISTORY: ChatHistoryVellumValueRequest
- SEARCH_RESULTS: SearchResultsVellumValueRequest
- THINKING: ThinkingVellumValueRequest

### StringVellumValueRequest

A value representing a string.

- `type` (enum, required)
  - Allowed values: `STRING`
- `value` (string, required, nullable)

### NumberVellumValueRequest

A value representing a number.

- `type` (enum, required)
  - Allowed values: `NUMBER`
- `value` (double, required, nullable)

### JsonVellumValueRequest

A value representing a JSON object.

- `type` (enum, required)
  - Allowed values: `JSON`
- `value` (any, required, nullable)

### AudioVellumValueRequest

A base Vellum primitive value representing audio.

- `type` (enum, required)
  - Allowed values: `AUDIO`
- `value` (VellumAudioRequest, required, nullable)

### VideoVellumValueRequest

A base Vellum primitive value representing a video.

- `type` (enum, required)
  - Allowed values: `VIDEO`
- `value` (VellumVideoRequest, required, nullable)

### ImageVellumValueRequest

A base Vellum primitive value representing an image.

- `type` (enum, required)
  - Allowed values: `IMAGE`
- `value` (VellumImageRequest, required, nullable)

### DocumentVellumValueRequest

A base Vellum primitive value representing a document.

- `type` (enum, required)
  - Allowed values: `DOCUMENT`
- `value` (VellumDocumentRequest, required, nullable)

### FunctionCallVellumValueRequest

A value representing a Function Call.

- `type` (enum, required)
  - Allowed values: `FUNCTION_CALL`
- `value` (FunctionCallRequest, required, nullable) — The final resolved function call value.

### ErrorVellumValueRequest

A value representing an Error.

- `type` (enum, required)
  - Allowed values: `ERROR`
- `value` (VellumErrorRequest, required, nullable)

### ArrayVellumValueRequest

A value representing an array of Vellum variable values.

- `type` (enum, required)
  - Allowed values: `ARRAY`
- `value` (list of VellumValueRequest, required, nullable)

### ChatHistoryVellumValueRequest

A value representing Chat History.

- `type` (enum, required)
  - Allowed values: `CHAT_HISTORY`
- `value` (list of ChatMessageRequest, required, nullable)

### SearchResultsVellumValueRequest

A value representing Search Results.

- `type` (enum, required)
  - Allowed values: `SEARCH_RESULTS`
- `value` (list of SearchResultRequest, required, nullable)

### ThinkingVellumValueRequest

A value representing Thinking mode output.

- `type` (enum, required)
  - Allowed values: `THINKING`
- `value` (StringVellumValueRequest, required, nullable) — A value representing a string.

### VellumAudioRequest

- `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details.
- `metadata` (map from string to any, optional, nullable)

### VellumVideoRequest

- `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details.
- `metadata` (map from string to any, optional, nullable)

### VellumImageRequest

- `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details.
- `metadata` (map from string to any, optional, nullable)

### VellumDocumentRequest

- `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details.
- `metadata` (map from string to any, optional, nullable)

### FunctionCallRequest

The final resolved function call value.

- `arguments` (map from string to any, required)
- `name` (string, required)
- `id` (string, optional, nullable)

### VellumErrorRequest

- `code` (enum, required) — * `INVALID_REQUEST` - INVALID_REQUEST * `INVALID_INPUTS` - INVALID_INPUTS * `PROVIDER_ERROR` - PROVIDER_ERROR * `PROVIDER_CREDENTIALS_UNAVAILABLE` - PROVIDER_CREDENTIALS_UNAVAILABLE * `INTEGRATION_CREDENTIALS_UNAVAILABLE` - INTEGRATION_CREDENTIALS_UNAVAILABLE * `REQUEST_TIMEOUT` - REQUEST_TIMEOUT * `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR * `USER_DEFINED_ERROR` - USER_DEFINED_ERROR * `WORKFLOW_CANCELLED` - WORKFLOW_CANCELLED * `NODE_CANCELLED` - NODE_CANCELLED * `PROVIDER_QUOTA_EXCEEDED` - PROVIDER_QUOTA_EXCEEDED * `CHAT_QUOTA_EXCEEDED` - CHAT_QUOTA_EXCEEDED
  - Allowed values: `INVALID_REQUEST`, `INVALID_INPUTS`, `PROVIDER_ERROR`, `PROVIDER_CREDENTIALS_UNAVAILABLE`, `INTEGRATION_CREDENTIALS_UNAVAILABLE`, `REQUEST_TIMEOUT`, `INTERNAL_SERVER_ERROR`, `USER_DEFINED_ERROR`, `WORKFLOW_CANCELLED`, `NODE_CANCELLED`, `PROVIDER_QUOTA_EXCEEDED`, `CHAT_QUOTA_EXCEEDED`
- `message` (string, required)
- `raw_data` (map from string to any, optional, nullable)

### ChatMessageRequest

- `role` (enum, required) — * `SYSTEM` - System * `ASSISTANT` - Assistant * `USER` - User * `FUNCTION` - Function
  - Allowed values: `SYSTEM`, `ASSISTANT`, `USER`, `FUNCTION`
- `text` (string, optional, nullable)
- `content` (ChatMessageContentRequest, optional, nullable)
- `source` (string, optional, nullable) — An optional identifier representing who or what generated this message.
- `metadata` (map from string to any, optional, nullable)

### SearchResultRequest

- `text` (string, required) — The text of the chunk that matched the search query.
- `score` (double, required) — A score representing how well the chunk matches the search query.
- `keywords` (list of string, required)
- `document` (SearchResultDocumentRequest, required) — The document that contains the chunk that matched the search query.
- `meta` (SearchResultMetaRequest, optional, nullable) — Additional information about the search result.

### ChatMessageContentRequest

- STRING: StringChatMessageContentRequest
- FUNCTION_CALL: FunctionCallChatMessageContentRequest
- ARRAY: ArrayChatMessageContentRequest
- AUDIO: AudioChatMessageContentRequest
- VIDEO: VideoChatMessageContentRequest
- IMAGE: ImageChatMessageContentRequest
- DOCUMENT: DocumentChatMessageContentRequest

### SearchResultDocumentRequest

- `label` (string, required) — The human-readable name for the document.
- `id` (string, optional, nullable) — The ID of the document.
- `external_id` (string, optional, nullable) — The unique ID of the document as represented in an external system and specified when it was originally uploaded.
- `metadata` (map from string to any, optional, nullable) — A previously supplied JSON object containing metadata that can be filtered on when searching.

### SearchResultMetaRequest

- `source` (SearchResultMetaSourceRequest, optional, nullable)

### StringChatMessageContentRequest

A string value that is used in a chat message.

- `type` (enum, required)
  - Allowed values: `STRING`
- `value` (string, required)

### FunctionCallChatMessageContentRequest

A function call value that is used in a chat message.

- `type` (enum, required)
  - Allowed values: `FUNCTION_CALL`
- `value` (FunctionCallChatMessageContentValueRequest, required) — The final resolved function call value.

### ArrayChatMessageContentRequest

A list of chat message content items.

- `type` (enum, required)
  - Allowed values: `ARRAY`
- `value` (list of ArrayChatMessageContentItemRequest, required)

### AudioChatMessageContentRequest

An audio value that is used in a chat message.

- `type` (enum, required)
  - Allowed values: `AUDIO`
- `value` (VellumAudioRequest, required)

### VideoChatMessageContentRequest

A video value that is used in a chat message.

- `type` (enum, required)
  - Allowed values: `VIDEO`
- `value` (VellumVideoRequest, required)

### ImageChatMessageContentRequest

An image value that is used in a chat message.

- `type` (enum, required)
  - Allowed values: `IMAGE`
- `value` (VellumImageRequest, required)

### DocumentChatMessageContentRequest

A document value that is used in a chat message.

- `type` (enum, required)
  - Allowed values: `DOCUMENT`
- `value` (VellumDocumentRequest, required)

### SearchResultMetaSourceRequest

- PDF: PdfSearchResultMetaSourceRequest

### FunctionCallChatMessageContentValueRequest

The final resolved function call value.

- `name` (string, required)
- `arguments` (map from string to any, required)
- `id` (string, optional, nullable)

### ArrayChatMessageContentItemRequest

- STRING: StringChatMessageContentRequest
- FUNCTION_CALL: FunctionCallChatMessageContentRequest
- AUDIO: AudioChatMessageContentRequest
- VIDEO: VideoChatMessageContentRequest
- IMAGE: ImageChatMessageContentRequest
- DOCUMENT: DocumentChatMessageContentRequest

### PdfSearchResultMetaSourceRequest

The source of a search result from a PDF document.

- `document_type` (enum, required)
  - Allowed values: `PDF`
- `start_page_num` (integer, required, nullable) — The 1-indexed page number where the chunk starts in the document. Only available for supported chunking strategies and document types.
- `end_page_num` (integer, required, nullable) — The 1-indexed page number where the chunk ends in the document. Only available for supported chunking strategies and document types.

## Examples

**Request**

```json
{
  "query": "string"
}
```

**Response**

```json
{
  "results": [
    {
      "text": "string",
      "score": 1.1,
      "keywords": [
        "string"
      ],
      "document": {
        "label": "string",
        "id": "string",
        "external_id": "string",
        "metadata": {}
      },
      "meta": {
        "source": {
          "document_type": "PDF",
          "start_page_num": 1,
          "end_page_num": 1
        }
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://predict.vellum.ai/v1/search"

payload = { "query": "string" }
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```typescript
import { VellumClient } from "vellum-ai";

const client = new VellumClient({ apiKey: "YOUR_API_KEY", apiVersion: "YOUR_API_VERSION" });
await client.search({
    query: "x"
});

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://predict.vellum.ai/v1/search"

	payload := strings.NewReader("{\n  \"query\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://predict.vellum.ai/v1/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://predict.vellum.ai/v1/search")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://predict.vellum.ai/v1/search', [
  'body' => '{
  "query": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://predict.vellum.ai/v1/search");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["query": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://predict.vellum.ai/v1/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```