Making Requests
Jumpstart your integration with our API by making your first request! Simply copy and paste the command below into your terminal. Ensure you have a stable internet connection to smoothly receive the server's response.
curl -X POST https://genai-openfxt.alwaysdata.net/api/ai-gen \
-H "Content-Type: application/json" \
-d '{"prompt": "Say this is a test!", "model": "null-flash"}'
This command sends a request to the null-flash
model to generate a text completion starting with the prompt "Say this is a test!". Upon execution, you'll receive a response similar to:
{
"success": true,
"message": "Success",
"text": "Okay, this is a test! I understand. What would you like me to do as part of this test?\n",
"contextId": "XzA04R0Hr1L67TuGUwO1"
}
Understanding the Response:
success
: Indicates whether the request was successful (true
) or not (false
).message
: Provides additional information about the request status.text
: Contains the generated response from the model based on your prompt.contextId
: A unique identifier for the conversation context, which we'll delve into in the next sections.
Now that you've made your first API call, you're all set to explore more advanced features and harness the full power of our API. Happy coding!
Last modified: 2 months ago