Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.93 KB

File metadata and controls

51 lines (36 loc) · 1.93 KB
title Authentication
description How to authenticate your API requests
icon key

The Supermodel API uses API keys to authenticate requests. You can view and manage your API keys in the Supermodel Dashboard.

**Using the API Playground**: The interactive playground in this documentation connects to our production API. Generate an API key from the [Supermodel Dashboard](https://dashboard.supermodeltools.com/) to test endpoints directly from these docs.

Authentication Header

Authentication to the Data Plane API is performed via the X-Api-Key header.

X-Api-Key: smsk_live_...

Idempotency Key

All API requests require an Idempotency-Key header. This is a unique value (such as a UUID) that you generate for each request. It serves three purposes:

  1. Job identity: The key identifies your graph generation job. Re-submitting the same key returns the existing job status rather than creating a duplicate.
  2. Polling: You poll for results by re-submitting the same request with the same idempotency key. See Async Polling for details.
  3. Request tracing: The key is echoed back in the X-Request-Id response header for debugging and support purposes.
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000

You can generate a UUID in most languages or use command-line tools like uuidgen.

Example Request

Here's how to include the headers in a cURL request:

curl --request POST \
  --url https://api.supermodeltools.com/v1/graphs/dependency \
  --header "Idempotency-Key: $(uuidgen)" \
  --header 'X-Api-Key: <your-api-key>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@./repo.zip'
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.