> This page is also available as Markdown: append .md to its URL. The full index of Sikaru docs is at https://docs.sikaru.ai/llms.txt. Code examples use only operations from the public API reference at https://docs.sikaru.ai/api-reference.

# Responses

POST https://api.sikaru.ai/v1/responses
Content-Type: application/json

Reference: https://docs.sikaru.ai/api-reference/responses/create

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an object.

- `model` (string, required)
- `stream` (false, required)
- `access_programs` (map from string to any, optional, nullable)
- `background` (boolean, optional, nullable)
- `context_management` (list of map from string to any, optional, nullable)
- `conversation` (V1ResponsesPostRequestBodyContentApplicationJsonSchemaConversation, optional, nullable)
- `include` (list of string, optional, nullable)
- `input` (V1ResponsesPostRequestBodyContentApplicationJsonSchemaInput, optional, nullable)
- `instructions` (string, optional, nullable)
- `max_output_tokens` (integer, optional, nullable)
- `max_tool_calls` (integer, optional, nullable)
- `metadata` (map from string to any, optional, nullable)
- `models` (list of string, optional, nullable)
- `moderation` (map from string to any, optional, nullable)
- `parallel_tool_calls` (boolean, optional, nullable)
- `previous_response_id` (string, optional, nullable)
- `prompt` (map from string to any, optional, nullable)
- `prompt_cache_key` (string, optional, nullable)
- `prompt_cache_options` (map from string to any, optional, nullable)
- `prompt_cache_retention` (string, optional, nullable)
- `provider` (map from string to any, optional, nullable)
- `reasoning` (map from string to any, optional, nullable)
- `route` (string, optional, nullable)
- `safety_identifier` (string, optional, nullable)
- `service_tier` (string, optional, nullable)
- `store` (boolean, optional, nullable)
- `stream_options` (map from string to any, optional, nullable)
- `temperature` (double, optional, nullable)
- `text` (map from string to any, optional, nullable)
- `tool_choice` (V1ResponsesPostRequestBodyContentApplicationJsonSchemaToolChoice, optional, nullable)
- `tools` (list of map from string to any, optional, nullable)
- `top_logprobs` (integer, optional, nullable)
- `top_p` (double, optional, nullable)
- `transforms` (list of string, optional, nullable)
- `truncation` (string, optional, nullable)
- `usage` (map from string to any, optional, nullable)
- `user` (string, optional, nullable)

## Response

### 200

- `id` (string, required)
- `object` (string, required)
- `completed_at` (double, optional, nullable)
- `created_at` (double, optional, nullable)
- `error` (map from string to any, optional, nullable)
- `incomplete_details` (map from string to any, optional, nullable)
- `instructions` (ModelResponseInstructions, optional, nullable)
- `max_output_tokens` (integer, optional, nullable)
- `max_tool_calls` (integer, optional, nullable)
- `model` (string, optional, nullable)
- `output` (list of map from string to any, optional, nullable)
- `output_text` (string, optional, nullable)
- `parallel_tool_calls` (boolean, optional, nullable)
- `reasoning` (map from string to any, optional, nullable)
- `status` (string, optional, nullable)
- `temperature` (double, optional, nullable)
- `text` (map from string to any, optional, nullable)
- `tool_choice` (ModelResponseToolChoice, optional, nullable)
- `tools` (list of map from string to any, optional, nullable)
- `top_logprobs` (integer, optional, nullable)
- `top_p` (double, optional, nullable)
- `truncation` (string, optional, nullable)
- `usage` (ResponseUsage, optional, nullable) — Public Response fields at this level (RESPONSE_USAGE_FIELDS); the projection omits the rest.

## Types

### V1ResponsesPostRequestBodyContentApplicationJsonSchemaConversation

- string
- map from string to any

### V1ResponsesPostRequestBodyContentApplicationJsonSchemaInput

- string
- list of map from string to any

### V1ResponsesPostRequestBodyContentApplicationJsonSchemaToolChoice

- string
- map from string to any

### ModelResponseInstructions

- string
- list of map from string to any

### ModelResponseToolChoice

- string
- map from string to any

### ResponseUsage

Public Response fields at this level (RESPONSE_USAGE_FIELDS); the projection omits the rest.

- `input_tokens` (integer, optional, nullable)
- `input_tokens_details` (map from string to any, optional, nullable)
- `output_tokens` (integer, optional, nullable)
- `output_tokens_details` (map from string to any, optional, nullable)
- `total_tokens` (integer, optional, nullable)

## Examples

**Request**

```json
{
  "model": "string",
  "stream": false
}
```

**SDK Code**

```python
import requests

url = "https://api.sikaru.ai/v1/responses"

payload = {
    "model": "string",
    "stream": False
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.sikaru.ai/v1/responses';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"model":"string","stream":false}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.sikaru.ai/v1/responses"

	payload := strings.NewReader("{\n  \"model\": \"string\",\n  \"stream\": false\n}")

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

	req.Header.Add("Authorization", "Bearer <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://api.sikaru.ai/v1/responses")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"string\",\n  \"stream\": false\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://api.sikaru.ai/v1/responses")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"string\",\n  \"stream\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sikaru.ai/v1/responses', [
  'body' => '{
  "model": "string",
  "stream": false
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.sikaru.ai/v1/responses");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"string\",\n  \"stream\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "string",
  "stream": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sikaru.ai/v1/responses")! 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()
```