> For the complete documentation index, see [llms.txt](https://docs.slier.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.slier.ai/api-reference/search.md).

# Search

### [The search completion object](https://docs.theb.ai/search#the-search-completion-object) <a href="#the-search-completion-object" id="the-search-completion-object"></a>

Represents a chat completion response returned by model, based on the provided input.

* Name`id`TypestringDescription

  A unique identifier for the chat completion.
* Name`object`TypestringDescription

  The object type, which is always `search.completion`.
* Name`created`TypestringDescription

  A unix timestamp of when the chat completion was created.
* Name`choices`TypearrayDescription

  A list of chat completion choices. Can be more than one if `n` is greater than 1.
* Name`choices[].index`TypeintegerDescription

  The index of the choice in the list of choices.
* Name`choices[].message`TypeobjectDescription

  A chat completion message generated by the model.
* Name`choices[].message.role`TypestringDescription

  The role of the author of this message.
* Name`choices[].message.content`Typestring or nullDescription

  The contents of the message.
* Name`choices[].finish_reason`TypestringDescription

  The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached.

#### The search completion object

```json
{
  "id": "d8b98fe4adb740d0a520e7bad7edb422",
  "object": "search.completion",
  "created": 1692156414,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Apple Vision Pro is an upcoming mixed-reality headset developed by Apple Inc. It was announced on June 5, 2023, at Apple's Worldwide Developers Conference. The headset is designed to bring a new dimension to powerful, personal computing by changing the way users interact with their favorite apps, capture and create content, and experience immersive digital environments³.\n\n![Apple Vision Pro](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT6SOsjwPQglqJP3WDgTaTetcvXc2pqm4hAoKH4uok&s=0)\n\nHere are some key features and specifications of the Apple Vision Pro:\n\n1. CPU: It is powered by the Apple M2 and R1 processors¹.\n2. Graphics: The headset features the Apple M2 (10 cores) processor running at 3.5 GHz, capable of delivering up to 3.6 TFLOPS of graphics performance¹.\n3. Input: The Apple Vision Pro incorporates 6DoF inside-out tracking, photogrammetry, and gesture recognition through 12 built-in cameras and lidar¹.\n4. Operating System: The headset runs on visionOS, which is an iOS-based operating system¹.\n5. Price: The introductory price for the Apple Vision Pro is set at US$3,499¹.\n6. Manufacturer: The manufacturing of the Apple Vision Pro is handled by Luxshare, an Apple supplier¹.\n\nThe Apple Vision Pro aims to provide users with a seamless blend of the real and digital world, enabling them to experience spatial computing like never before. It is expected to be available for purchase in the United States in early 2024 and later in other regions¹.\n\nI hope this information gives you a good understanding of Apple Vision Pro. Let me know if there's anything else you would like to know! 😊"
      },
      "finish_reason": "stop"
    }
  ],
}
```

***

### [The search completion chunk object](https://docs.theb.ai/search#the-search-completion-chunk-object) <a href="#the-search-completion-chunk-object" id="the-search-completion-chunk-object"></a>

Represents a streamed chunk of a search completion response returned by model, based on the provided input.

* Name`id`TypestringDescription

  A unique identifier for the chat completion.
* Name`object`TypestringDescription

  The object type, which is always `search.completion`.
* Name`created`TypestringDescription

  A unix timestamp of when the chat completion was created.
* Name`choices`TypearrayDescription

  A list of chat completion choices. Can be more than one if `n` is greater than 1.
* Name`choices[].index`TypeintegerDescription

  The index of the choice in the list of choices.
* Name`choices[].delta`TypeobjectDescription

  A chat completion delta generated by streamed model responses.
* Name`choices[].delta.role`TypestringDescription

  The role of the author of this message.
* Name`choices[].delta.content`Typestring or nullDescription

  The contents of the chunk message.
* Name`choices[].finish_reason`Typestring or nullDescription

  The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached.

#### The search completion chunk object

```json
{
  "id": "d8b98fe4adb740d0a520e7bad7edb422",
  "object": "search.completion.chunk",
  "created": 1692156414,
  "choices": [
    {
      "index": 0,
      "delta": {
          "role": "assistant",
          "content": ""
      },
      "finish_reason": null
    }
  ],
  "finish": false
}

......

{
  "id": "877707a665544ccbbf61fa42c722f4df",
  "object": "search.completion.chunk",
  "created": 1692157004,
  "choices": [
    {
      "index": 0,
      "delta": {},
      "finish_reason": "stop"
    }
  ],
  "finish": true
}

[DONE]
```

***

### [Create search completion](https://docs.theb.ai/search#create-search-completion) <a href="#create-search-completion" id="create-search-completion"></a>

Creates a model response for the given search conversation.

**POST <https://api.Slier.ai/v1/search/completions>**

**POST <https://api.Slier.ai/v2/search/completions>**

**Available parameters**

`messages` array Required A list of messages comprising the conversation so far.

* `role` string Required
  * The role of the messages author. One of `system`, `user` or `assistant`.
* `content` string Required
  * The contents of the message. `content` is required for all messages.

`stream` boolean or null Optional Defaults to false If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message.

#### Example Request

POST/v1/search/completions

```python
import requests
import json

url = "https://api.Slier.ai/v1/search/completions"
# url = "https://api.Slier.ai/v2/search/completions"

payload = json.dumps({
  "messages": [
    {
      "role": "user",
      "content": "Tell me more about Apple Vision Pro."
    }
  ],
  "stream": false
})
headers = {
  'Authorization': 'Bearer $API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.json())
```

#### The chat completion object

```json
{
  "id": "d8b98fe4adb740d0a520e7bad7edb422",
  "object": "search.completion",
  "created": 1692156414,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Apple Vision Pro is an upcoming mixed-reality headset developed by Apple Inc. It was announced on June 5, 2023, at Apple's Worldwide Developers Conference. The headset is designed to bring a new dimension to powerful, personal computing by changing the way users interact with their favorite apps, capture and create content, and experience immersive digital environments³.\n\n![Apple Vision Pro](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT6SOsjwPQglqJP3WDgTaTetcvXc2pqm4hAoKH4uok&s=0)\n\nHere are some key features and specifications of the Apple Vision Pro:\n\n1. CPU: It is powered by the Apple M2 and R1 processors¹.\n2. Graphics: The headset features the Apple M2 (10 cores) processor running at 3.5 GHz, capable of delivering up to 3.6 TFLOPS of graphics performance¹.\n3. Input: The Apple Vision Pro incorporates 6DoF inside-out tracking, photogrammetry, and gesture recognition through 12 built-in cameras and lidar¹.\n4. Operating System: The headset runs on visionOS, which is an iOS-based operating system¹.\n5. Price: The introductory price for the Apple Vision Pro is set at US$3,499¹.\n6. Manufacturer: The manufacturing of the Apple Vision Pro is handled by Luxshare, an Apple supplier¹.\n\nThe Apple Vision Pro aims to provide users with a seamless blend of the real and digital world, enabling them to experience spatial computing like never before. It is expected to be available for purchase in the United States in early 2024 and later in other regions¹.\n\nI hope this information gives you a good understanding of Apple Vision Pro. Let me know if there's anything else you would like to know! 😊"
      },
      "finish_reason": "stop"
    }
  ]
}
```

#### Contents Filtered

```json
{
  "error": {
    "message": "This content may violate our content policy, please check https://Slier.ai/terms to learn more. If you believe this to be in error, please contact us at safety@Slier.ai to keep our systems safe and available.",
    "param": "prompt",
    "reason": "content_filter",
    "status": 400
  }
}
```
