API reference

Available on Business and above.

Use the Cuppa API to generate content and images using AI. The capabilities of the API are defined in the next sections.

Authentication

To use the API, you need to authenticate using an API key. Go to your Cuppa settings to obtain an API key. Include the API key in the X-API-KEY header of your requests as follows:

curl -X GET "https://api.cuppa.ai/v1/meta" \
  -H "accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY"

Rate Limiting

The API has rate limits in place to ensure fair usage.

Error Handling

The API returns standard HTTP status codes to indicate the success or failure of a request. In case of an error, the response will contain an error object with details about the error.

Get all metadata

get
Authorizations
X-API-KEYstringRequired
Responses
200

Metadata object

application/json
get
/v1/meta
200

Metadata object

Get available models

get
Authorizations
X-API-KEYstringRequired
Responses
200

A list of model names

application/json
Responsestring[]
get
/v1/meta/models
200

A list of model names

Get available image models

get
Authorizations
X-API-KEYstringRequired
Responses
200

A list of image model names

application/json
Responsestring[]
get
/v1/meta/image_models
200

A list of image model names

Get available languages

get
Authorizations
X-API-KEYstringRequired
Responses
200

A list of supported languages

application/json
get
/v1/meta/languages
200

A list of supported languages

Get available regions

get
Authorizations
X-API-KEYstringRequired
Responses
200

A list of supported regions

application/json
get
/v1/meta/regions
200

A list of supported regions

Fetch list of generated images

get
Authorizations
X-API-KEYstringRequired
Query parameters
limitinteger · max: 50Optional

Maximum number of images to return (max 50, default 20)

Responses
200

A list of generated images

application/json
get
/v1/images
200

A list of generated images

Create an image

post
Authorizations
X-API-KEYstringRequired
Body
modelstringRequired

The model to use for image generation. Use the /v1/meta/image_models endpoint to get available image models.

promptstring · max: 1000Required

The prompt to use for image generation

Responses
200

Successfully generated image

application/json
post
/v1/images
200

Successfully generated image

Fetch list of articles

get
Authorizations
X-API-KEYstringRequired
Query parameters
pageinteger | nullableOptional

Page number for pagination

langstring | nullableOptional

Filter by language code

projectstring | nullableOptional

Filter by project ID. If not provided, it will return the articles not part of any project. Use all to get all articles.

Responses
200

A list of articles

application/json
get
/v1/contents
200

A list of articles

Create a new article

post
Authorizations
X-API-KEYstringRequired
Body
target_keywordstringRequired

The target_keyword for the article.

modelstringOptional

The model to use for the article.

Default: gpt-4o-mini
settings_presetnumber | nullableOptional

The settings preset to use for the article. Use the settings object to override specific settings. Go to your presets to create a preset.

is_draftbooleanOptional

Whether the article is a draft

Default: false
Responses
200

Article created successfully

application/json
post
/v1/contents
200

Article created successfully

Get an article by ID

get
Authorizations
X-API-KEYstringRequired
Path parameters
idstringRequired

The ID of the article

Responses
200

The article object

application/json
get
/v1/contents/{id}
200

The article object

Get the current status of an article

get
Authorizations
X-API-KEYstringRequired
Path parameters
idstringRequired

The ID of the article

Responses
200

The status of the article

application/json
get
/v1/contents/{id}/status
200

The status of the article

Fetch list of projects

get
Authorizations
X-API-KEYstringRequired
Responses
200

A list of projects

application/json
get
/v1/projects
200

A list of projects

Create a new project

post
Authorizations
X-API-KEYstringRequired
Body
project_namestring · max: 100Required

Name of the project

modelstringOptional

The model to use for the article. Use the /v1/meta/models endpoint to get available models.

Default: gpt-4o-mini
common_settings_presetnumber | nullableOptional

The settings preset to use for the project. Use the common_settings object to override specific settings. Go to your presets to create a preset.

target_keywordsstring[] · min: 1 · max: 600Required

The target keywords to generate content for.

Responses
200

Project created successfully

application/json
post
/v1/projects
200

Project created successfully

Get a project by ID

get
Authorizations
X-API-KEYstringRequired
Path parameters
idstringRequired

The ID of the project

Responses
200

The project object

application/json
get
/v1/projects/{id}
200

The project object

Last updated

Was this helpful?