Serverless AI Text Prompt Generation

AI powered text prompt generation service that generates prompts or completions based on user input, context and language. You can generate code, text, or any other content based on the user input and context.

Endpoint

Generate a prompt or completion based on user input, context, and language

POSThttps://api.xtartapp.com/text/prompt

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
contextarray of stringsNo250Optional. Up to 10 context strings (max 250 chars each) to provide additional information for the prompt.
promptstringYes1000The main user input or prompt to generate a completion for.
languagestringNo-Optional. The language code for the output. Supported: AUTO, en, es, fr, de, zh, ja, ko, pt, it, ru, ar, hi. Defaults to AUTO.

Response

NameTypeDescription
descriptionstringThe description of the prompt.
responsestringThe generated or completed text based on the prompt and context.

Errors

{
  "error": "string",
  "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid. E.g., missing required fields, context too long, or too many context items.
400INVALID_REQUESTEx.: The request is invalid.
400TEXT_PROMPT_GENERATION_ERROREx: could not generate prompt or completion | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.