cURL Example
Example of a curl request and response for model inference
Contents
MAC OS/Linux
curl -X POST \
-H "Content-Type: application/json" \
-H "x-corsali-organization-id: Xxx..-...." \
-H "Authorization: Bearer eyJxxx.eyJxxx.1ANxxx" \
-d @example_json https://api.corsali.com/predict/Xxxx...-...
Windows
curl -X POST ^
-H "Content-Type: application/json" ^
-H "x-corsali-organization-id: irjt4o3t-...." ^
-H "Authorization: Bearer eyJxxx.eyJxxx.1ANxxx" ^
-d @example_json https://api.corsali.com/predict/Xxxx...-...
Explanation:
The type of request is denoted by "-X"
Since we are making a post request we denote it as such
Here we can see the 3 headers denoted by "-H":
Content-Type (application/json is an example content type)
x-corsali-organization-id (Xxx..-.... is an example organization id)
Authorization (eyJxxx.eyJxxx.1ANxxx is an example authentication key)
The model specific values can be found 👉 here.
The input data is denoted with "-d":
example_json is an example input file
When referencing a json file the file must be in the current path and denoted with "@"
If the json text is passed in directly the "@" can be omitted.
More information on input data (example_json is an example input file)
The last part of the request is the URL:
Base URL: https://api.corsali.com/predict/ is the base URL
Path: "Xxxx...-..." is an example model id
cURL Response
{"data":{"modelResponse":["example"],"modelResponseFloat":3}, "warning":"Example Warning"}
An example cURL response made up of data returned from the model and a warning. For more information see response.
Last updated
Was this helpful?