Ask AI
curl --request POST \
--url https://api.velt.dev/v2/rewriter/ask-ai \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"model": "<string>",
"prompt": "<string>",
"text": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/rewriter/ask-ai"
payload = { "data": {
"model": "<string>",
"prompt": "<string>",
"text": "<string>"
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({data: {model: '<string>', prompt: '<string>', text: '<string>'}})
};
fetch('https://api.velt.dev/v2/rewriter/ask-ai', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.velt.dev/v2/rewriter/ask-ai",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'model' => '<string>',
'prompt' => '<string>',
'text' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.velt.dev/v2/rewriter/ask-ai"
payload := strings.NewReader("{\n \"data\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"text\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.velt.dev/v2/rewriter/ask-ai")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"text\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/rewriter/ask-ai")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"text\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"success": true,
"text": "The rewritten or processed text returned by the model."
}
}
Rewriter
Ask AI
POST
/
v2
/
rewriter
/
ask-ai
Ask AI
curl --request POST \
--url https://api.velt.dev/v2/rewriter/ask-ai \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"model": "<string>",
"prompt": "<string>",
"text": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/rewriter/ask-ai"
payload = { "data": {
"model": "<string>",
"prompt": "<string>",
"text": "<string>"
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({data: {model: '<string>', prompt: '<string>', text: '<string>'}})
};
fetch('https://api.velt.dev/v2/rewriter/ask-ai', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.velt.dev/v2/rewriter/ask-ai",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'model' => '<string>',
'prompt' => '<string>',
'text' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.velt.dev/v2/rewriter/ask-ai"
payload := strings.NewReader("{\n \"data\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"text\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.velt.dev/v2/rewriter/ask-ai")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"text\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/rewriter/ask-ai")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"text\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"success": true,
"text": "The rewritten or processed text returned by the model."
}
}
Use this API to send a text rewriting or processing request to an AI model. The model provider is resolved automatically from the model name prefix.
Customer API keys are stored encrypted in the workspace
aiModelsConfig and decrypted server-side. Configure your provider API keys in the Velt Console before using this endpoint.Endpoint
POST https://api.velt.dev/v2/rewriter/ask-ai
Headers
Your API key.
Your Auth Token.
Body
Params
Show properties
Show properties
OpenAI reasoning models (
o1-*, o3-*, o4-*) use a user-only message format. The prompt is prepended to the text in a single user message rather than sent as a separate system prompt.Supported models (non-exhaustive)
| Provider | Example models |
|---|---|
| OpenAI | gpt-4o, gpt-4o-mini, gpt-4.1, o3, o3-mini, o4-mini |
| Anthropic | claude-sonnet-4-0, claude-opus-4-0, claude-haiku-4-5 |
| Gemini | gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite |
Example Requests
Rewrite text using Claude
{
"data": {
"model": "claude-3-5-sonnet-20241022",
"prompt": "Rewrite the following text to be more concise and professional.",
"text": "Hey so I was just thinking that maybe we could potentially look into making some changes to the way we do things around here."
}
}
Rewrite text using GPT-4o
{
"data": {
"model": "gpt-4o",
"prompt": "Fix the grammar and spelling in the following text.",
"text": "Their going to the store to by some apples."
}
}
Process text using a reasoning model
{
"data": {
"model": "o3-mini",
"prompt": "Summarize the key points from the following text.",
"text": "Long document text content goes here..."
}
}
Response
Success Response
{
"result": {
"success": true,
"text": "The rewritten or processed text returned by the model."
}
}
Error Response
{
"result": {
"success": false,
"error": "No API key configured for provider: OpenAI"
}
}
Failure Response
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
{
"result": {
"success": true,
"text": "The rewritten or processed text returned by the model."
}
}
Was this page helpful?
⌘I

