Skip to content
Browse all functions

Ask AI

ai/askai

askai (Ask AI) is a 1001fx API function in the group AI: POST https://api.1001fx.com/ai/askai, 4 credits per 1,000 tokens (minimum 4). It works as a ready-made module in Make and n8n or as a plain HTTP call.

Gets an answer from an AI, based on predefined templates or a custom prompt. Charged per used tokens.

  • This service is provided by an external service provider: Microsoft Azure OpenAI. The data of the call is sent to the provider. More about service providers

Use cases

  • Summarize incoming support emails before they go into your helpdesk
  • Translate product descriptions from a Google Sheet into another language
  • Anonymize customer texts before you store or share them
  • Pull action items out of meeting notes and post them to a task list

Try it in the 1001fx app

Run askai in your browser with your API key – fill the form, click Run and get the answer or the file.

askai in the 1001fx app: the form with example values
Ask AI in the 1001fx app

Endpoint

POSThttps://api.1001fx.com/ai/askai
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
application/json

Parameters

  • textstringrequired

    Text that will be send to the AI

    Example:
    Explain nocode software development to a six year old kid.
  • temperaturenumberoptional

    What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

    Default:
    1
    Min:
    0
    Max:
    2
    Example:
    0
  • maxTokensnumberoptional

    The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens(except for the newest models, which support 4096). 1 token ~= 4 chararcters in english, 1 token ~= 3/4 words

    Default:
    256
    Example:
    16
  • modelenumoptional

    AI model to be used. Defaults to gpt-6.1-terra

    Values:
    gpt-3.5-turbo
    gpt-4
    gpt-6.1-terra
    gpt-6-luna
    Default:
    gpt-6.1-terra
    Example:
    gpt-4
  • systemMessagestringoptional

    Provide an optional system message to use.

    Default:
    You are a helpful assistant.
    Example:
    Antworte immer auf deutsch
  • promptTemplateenumrequired

    AI model to be used.

    Values:
    Summarize
    Make Longer
    Make Shorter
    Check Spelling and Grammar
    Change Tone
    Simplify
    Translate
    Explain This
    Find Action Items
    Continue Writing
    Anonymize Text
    Add Details
    Improve Writing
    Custom
    Example:
    Custom
  • paramsobjectoptional
    • customPromptstringoptional

      Custom prompt to use. This field is only used if prompt is custom. Inlcude %TEXT% as a placeholder in your custom prompt to access the value provided in text.

      Example:
      Make the text longer up to 50 words. %TEXT%.
    • translationLanguagestringoptional

      Language to translate your text to. This field is only used if prompt is Translate.

      Example:
      deutsch
    • tonestringoptional

      Language to translate your text to. This field is only used if prompt is Translate.

      Example:
      friendly

Examples

Summarize a text

Prompt template "Summarize".

Input

Expects a json body
{
  "text": "Low-code platforms let teams build workflows by connecting ready-made blocks instead of writing code. They speed up delivery, but complex logic still needs developers.",
  "promptTemplate": "Summarize",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Low-code platforms let teams build workflows by connecting ready-made blocks instead of writing code. They speed up delivery, but complex logic still needs developers.","promptTemplate":"Summarize","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Make a text longer

Prompt template "Make Longer".

Input

Expects a json body
{
  "text": "Elon Musk is the boss at Tesla.",
  "promptTemplate": "Make Longer",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Elon Musk is the boss at Tesla.","promptTemplate":"Make Longer","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Make a text shorter

Prompt template "Make Shorter".

Input

Expects a json body
{
  "text": "We are happy to let you know that your order has been shipped today and will arrive at your address within the next two to three business days.",
  "promptTemplate": "Make Shorter",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"We are happy to let you know that your order has been shipped today and will arrive at your address within the next two to three business days.","promptTemplate":"Make Shorter","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Check spelling and grammar

Prompt template "Check Spelling and Grammar".

Input

Expects a json body
{
  "text": "This ia a text wit a few mistaks in it.",
  "promptTemplate": "Check Spelling and Grammar",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"This ia a text wit a few mistaks in it.","promptTemplate":"Check Spelling and Grammar","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Change the tone

Prompt template "Change Tone" with params.tone.

Input

Expects a json body
{
  "text": "Send me the report now.",
  "promptTemplate": "Change Tone",
  "params": {
    "tone": "friendly"
  },
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Send me the report now.","promptTemplate":"Change Tone","params":{"tone":"friendly"},"model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Simplify a text

Prompt template "Simplify".

Input

Expects a json body
{
  "text": "The implementation of the aforementioned measures is contingent upon budgetary approval.",
  "promptTemplate": "Simplify",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"The implementation of the aforementioned measures is contingent upon budgetary approval.","promptTemplate":"Simplify","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Translate a text

Prompt template "Translate" with params.translationLanguage.

Input

Expects a json body
{
  "text": "Hello, how are you?",
  "promptTemplate": "Translate",
  "params": {
    "translationLanguage": "spanish"
  },
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Hello, how are you?","promptTemplate":"Translate","params":{"translationLanguage":"spanish"},"model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Explain a text

Prompt template "Explain This".

Input

Expects a json body
{
  "text": "An API rate limit of 500 requests per 60 seconds per route.",
  "promptTemplate": "Explain This",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"An API rate limit of 500 requests per 60 seconds per route.","promptTemplate":"Explain This","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Find action items

Prompt template "Find Action Items".

Input

Expects a json body
{
  "text": "Anna sends the offer by Friday. Tom books the meeting room for the workshop next week.",
  "promptTemplate": "Find Action Items",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Anna sends the offer by Friday. Tom books the meeting room for the workshop next week.","promptTemplate":"Find Action Items","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Continue writing

Prompt template "Continue Writing".

Input

Expects a json body
{
  "text": "Elon Musk is the boss at Tesla.",
  "promptTemplate": "Continue Writing",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Elon Musk is the boss at Tesla.","promptTemplate":"Continue Writing","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Anonymize a text

Prompt template "Anonymize Text".

Input

Expects a json body
{
  "text": "Elon Musk is the boss at Tesla.",
  "promptTemplate": "Anonymize Text",
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Elon Musk is the boss at Tesla.","promptTemplate":"Anonymize Text","model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Custom prompt

Prompt template "Custom": params.customPrompt with %TEXT% as placeholder for the text.

Input

Expects a json body
{
  "text": "Today is a sunny day.",
  "promptTemplate": "Custom",
  "params": {
    "customPrompt": "Make the text longer up to 50 words. \"%TEXT%\"."
  },
  "model": "gpt-6.1-terra",
  "temperature": 0,
  "maxTokens": 256
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Today is a sunny day.","promptTemplate":"Custom","params":{"customPrompt":"Make the text longer up to 50 words. \"%TEXT%\"."},"model":"gpt-6.1-terra","temperature":0,"maxTokens":256}'

Frequently asked questions

Which prompt templates are available?
Summarize, Make Longer, Make Shorter, Check Spelling and Grammar, Change Tone, Simplify, Translate, Explain This, Find Action Items, Continue Writing, Anonymize Text, Add Details, Improve Writing and Custom.
How do I use my own prompt?
Choose the template Custom and write your prompt in params.customPrompt. The placeholder %TEXT% is replaced with the value of text.
Why is the answer cut off?
maxTokens limits the length of the answer and defaults to 256 tokens. Raise it for longer answers. The call is charged per used token.

Try askai now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.015.08.2023created
Ask 1001fx