Optimize
Optimize a given text using specific instructions.
NodeJS
const rpai = await ai.optimize({
text: "FakeBrand Boa XL Max Water Pump Pliers in a Festive Christmas Ornament",
instruction: "SEO for an online store product title",
});
console.log("Optimized title:", rpai.response);
.NET
//Response format can be created manually but it is easier to use a type
//await ai.Optimize(new() {
//Text= "FakeBrand Boa XL Max Water Pump Pliers in a Festive Christmas Ornament",
//Instruction= "SEO for an online store product title"
//}).ConfigureAwait(false);
var rpai = await ai.Optimize<string>(new() {
Text= "FakeBrand Boa XL Max Water Pump Pliers in a Festive Christmas Ornament",
Instruction= "SEO for an online store product title"
}).ConfigureAwait(false);
Console.WriteLine("Optimized title: {0}", rpai);
/api/v1/ai/Optimize – Optimize Text Based on Instructions
Method:
POST
Parameters:
text
: (string) – The text to optimize.instruction
: (string) – The instruction for optimizing the text.responseFormat
: (string) – The format of the response (e.g.,text
,json
).
Request Example:
curl -X POST https://production.cloudbrowser.ai/api/v1/ai/Optimize \
-H "Content-Type: application/json" \
-d '{
"text": "10 Tips for Gardening",
"instruction": "Make the title more engaging for SEO",
"responseFormat": "text"
}'
Last updated