Skip to content
Browse all functions

Ask OpenAI

ai/askopenai

askopenai (Ask OpenAI) is a 1001fx API function in the group AI: POST https://api.1001fx.com/ai/askopenai, 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.

Get answer from OpenAI GPT. Will be charged per used OpenAI 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

Try it in the 1001fx app

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

askopenai in the 1001fx app: the form with example values
Ask OpenAI in the 1001fx app

Endpoint

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

Parameters

  • promptstringrequired

    Prompt that will be send to OpenAI

    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.8
  • 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:
    16
    Example:
    16
  • modelenumrequired

    Open AI model to be used. Defaults to gpt-6-luna

    Values:
    text-davinci-003
    text-davinci-002
    text-curie-001
    text-babbage-001
    text-ada-001
    gpt-6.1-terra
    gpt-6-luna
    Default:
    gpt-6-luna
    Example:
    text-davinci-003

Examples

Ask open ai

Returns answer

Input

Expects a json body
{
  "prompt": "Explain nocode software development to a six year old kid.",
  "temperature": 0.8,
  "maxTokens": 16,
  "model": "text-davinci-003"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/ai/askopenai' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"Explain nocode software development to a six year old kid.","temperature":0.8,"maxTokens":16,"model":"text-davinci-003"}'

Try askopenai now

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

Changelog

  • 1.0.011.03.2023created
Ask 1001fx