Quick Start
Follow these steps to quickly get started with Seaplane.
-
Create an account on the Flightdeck and follow the instructions to set up billing. Flightdeck automatically creates your first project and API key once you complete the billing setup.
-
Install the seaplane SDK. Open a terminal and run
pip3 install seaplane
. Make sure you have Python 3.10 or higher installed on your machine. We recommend you create a virtual environment to avoid dependency conflicts. Confirm everything is working correctly by runningseaplane --version
. This should return the currently installed Seaplane version. -
Create your first application by running
seaplane init hello-world
. This creates the default Seaplane directory structure and populates themain.py
file with a hello world app. -
Open the
.env
file in the root directory of your project. Replacesp-your-api-key
with your Seaplane API key which you can get from the Flightdeck. -
Open a terminal and navigate into
hello-world/
directory created in step three. Runpoetry install
to install the required packages followed byseaplane deploy
to deploy your first application. -
Your new application is now available at
https://carrier.cplane.cloud/v1/endpoints/hello-world-app
. Start a new batch request by calling your endpoint with aPOST
request.- cURL
- Plane
TOKEN=$(curl -X POST https://flightdeck.cplane.cloud/identity/token --header "Authorization: Bearer ${API_KEY}")
curl -X POST -H 'Content-Type: application/octet-stream' \
-H "Authorization: Bearer $TOKEN" \
-d '{"input" : [{"hello": "world"}]}' https://carrier.cplane.cloud/v1/endpoints/hello-world-app/requestFirst, configure
plane
using this guide.Use
plane
to call your endpoint with aPOST
request:plane endpoints request hello-world-app -d '{"input" : [{"hello": "world"}]}'
-
Query the API for the output of your batch request using the
request_id
(batch-id) output from step six and theGET
request listed below.- cURL
- Plane
curl -X GET -H "Authorization: Bearer $TOKEN" https://carrier.cplane.cloud/v1/endpoints/hello-world-app/response/<YOUR-BATCH-ID>.1
Configure
plane
using this guide if you have not already.Use
plane
to query the API for the output of the request:plane endpoints response hello-world-app <YOUR-BATCH-ID>.1
-
If implemented correctly, your API returns the batch-id, "hello world", and status "completed".
{"id":"b8329b4b-6ecc-46bf-878a-3cf420a8524a","output":["hello world"],"status":"completed"}