Corsali
  • Documentation Overview
  • Model API
    • cURL Example
    • Python Example
    • Errors
  • First Time User Guide
    • API Walkthrough
  • Authentication Keys
Powered by GitBook
On this page
  • Contents
  • MAC OS/Linux
  • Windows
  • Explanation:
  • cURL Response

Was this helpful?

  1. Model API

cURL Example

Example of a curl request and response for model inference

PreviousModel APINextPython Example

Last updated 3 years ago

Was this helpful?

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":

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.

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"}

(application/json is an example content type)

(Xxx..-.... is an example organization id)

(eyJxxx.eyJxxx.1ANxxx is an example authentication key)

The model specific values can be found 👉 .

(example_json is an example input file)

An example cURL response made up of data returned from the model and a warning. For more information see .

here
MAC OS/Linux
Windows
Explanation
cURL Response
Content-Type
x-corsali-organization-id
Authorization
More information on input data
More Information on the URL format
response