Skip to main content

Chat

Responses

Requests in the OpenAI Responses format. Each request stands alone, so send the whole conversation.

posthttps://api.pre.dev/v1/responsesTry it
curl -X POST "https://api.pre.dev/v1/responses" \  -H "Content-Type: application/json" \  -d '{    "model": "deepseek/deepseek-v4.1-flash-1017",    "input": "Say hello in five words.",    "max_output_tokens": 100,    "reasoning": {      "enabled": false    },    "stream": false  }'
const body = JSON.stringify({  "model": "deepseek/deepseek-v4.1-flash-1017",  "input": "Say hello in five words.",  "max_output_tokens": 100,  "reasoning": {    "enabled": false  },  "stream": false})fetch("https://api.pre.dev/v1/responses", {  method: "POST",  headers: {    "Content-Type": "application/json"  },  body})
package mainimport (  "fmt"  "net/http"  "io/ioutil"  "strings")func main() {  url := "https://api.pre.dev/v1/responses"  body := strings.NewReader(`{    "model": "deepseek/deepseek-v4.1-flash-1017",    "input": "Say hello in five words.",    "max_output_tokens": 100,    "reasoning": {      "enabled": false    },    "stream": false  }`)  req, _ := http.NewRequest("POST", url, body)  req.Header.Add("Content-Type", "application/json")  res, _ := http.DefaultClient.Do(req)  defer res.Body.Close()  body, _ := ioutil.ReadAll(res.Body)  fmt.Println(res)  fmt.Println(string(body))}
import requestsurl = "https://api.pre.dev/v1/responses"body = """{  "model": "deepseek/deepseek-v4.1-flash-1017",  "input": "Say hello in five words.",  "max_output_tokens": 100,  "reasoning": {    "enabled": false  },  "stream": false}"""response = requests.request("POST", url, data = body, headers = {  "Content-Type": "application/json"})print(response.text)
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.net.http.HttpResponse.BodyHandlers;import java.time.Duration;import java.net.http.HttpRequest.BodyPublishers;var body = BodyPublishers.ofString("""{  "model": "deepseek/deepseek-v4.1-flash-1017",  "input": "Say hello in five words.",  "max_output_tokens": 100,  "reasoning": {    "enabled": false  },  "stream": false}""");HttpClient client = HttpClient.newBuilder()  .connectTimeout(Duration.ofSeconds(10))  .build();HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()  .uri(URI.create("https://api.pre.dev/v1/responses"))  .header("Content-Type", "application/json")  .POST(body)  .build();try {  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());  System.out.println("Status code: " + response.statusCode());  System.out.println("Response body: " + response.body());} catch (Exception e) {  e.printStackTrace();}
using System;using System.Net.Http;using System.Text;var body = new StringContent("""{  "model": "deepseek/deepseek-v4.1-flash-1017",  "input": "Say hello in five words.",  "max_output_tokens": 100,  "reasoning": {    "enabled": false  },  "stream": false}""", Encoding.UTF8, "application/json");var client = new HttpClient();var response = await client.PostAsync("https://api.pre.dev/v1/responses", body);var responseBody = await response.Content.ReadAsStringAsync();
use reqwest::{Result, Client};async fn main() -> Result<()> {  let client = Client::new();  let url = "https://api.pre.dev/v1/responses";  let body = r#"{    "model": "deepseek/deepseek-v4.1-flash-1017",    "input": "Say hello in five words.",    "max_output_tokens": 100,    "reasoning": {      "enabled": false    },    "stream": false  }"#;  let res = client    .post(url)    .header("Content-Type", "application/json")    .body(body)    .send()    .await?    .text()    .await?;  println!("{}", res);  Ok(())}
{  "id": "pdg-043293a6-d1a8-4695-81fe-603ad4661ebb",  "object": "response",  "created_at": 1790500000,  "model": "deepseek/deepseek-v4.1-flash-1017",  "status": "completed",  "output": [    {      "type": "message",      "role": "assistant",      "content": [        {          "type": "output_text",          "text": "Hello there, nice to meet you."        }      ]    }  ],  "usage": {    "input_tokens": 12,    "output_tokens": 8,    "total_tokens": 20  }}
POST
/v1/responses

Authorization

AuthorizationBearer <token>

The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.

In: header

Header Parameters

x-predev-project-id?string

Attribute this call to one of the workspace's projects. An id the workspace does not own is ignored.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

The response object, or Responses API events when stream is true.

TypeScript Definitions

Use the response body type in TypeScript.

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Was this page helpful?