Civitai API (2024-09-19)

Download OpenAPI specification:

getCreators

query Parameters
limit
integer <int64> [ 0 .. 200 ]
Default: 20

The number of results to be returned per page. This can be a number between 0 and 200. By default, each page will return 20 results. If set to 0, it'll return all the creators.

page
integer <int64>

The page from which to start fetching creators.

query
string

Search query to filter creators by username.

Responses

Response samples

Content type
application/json
{}

getImages

query Parameters
limit
integer <int64> [ 0 .. 200 ]
Default: 100

The number of results to be returned per page.

postId
integer <int64>

The ID of a post to get images from.

modelId
integer <int64>

The ID of a model to get images from (model gallery).

modelVersionId
integer <int64>

The ID of a model version to get images from (model gallery filtered to version).

username
string

Filter to images from a specific user.

nsfw
boolean

Filter to images that contain mature content flags or not (undefined returns both).

sort
string
Enum: "Most Reactions" "Most Comments" "Newest"

The order in which you wish to sort the results.

period
string
Enum: "AllTime" "Year" "Month" "Week" "Day"

The time frame in which the images will be sorted.

page
integer <int64>

The page from which to start fetching creators.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "metadata": {}
}

getModels

query Parameters
limit
integer <int64> [ 0 .. 200 ]
Default: 100

The number of results to be returned per page. This can be a number between 1 and 200. By default, each page will return 100 results.

page
integer <int64>

The page from which to start fetching models.

query
string

Search query to filter models by name.

tag
string

Search query to filter models by tag.

username
string

Search query to filter models by user.

types
string
Enum: "Checkpoint" "TextualInversion" "Hypernetwork" "AestheticGradient" "LORA" "LyCORIS" "Controlnet" "Wildcards" "Poses" "Other"

The type of model you want to filter with. If none is specified, it will return all types.

sort
string
Enum: "Highest Rated" "Most Downloaded" "Newest"

The order in which you wish to sort the results.

period
string
Enum: "AllTime" "Year" "Month" "Week" "Day"

The time frame in which the models will be sorted.

rating
number <int64>

The rating you wish to filter the models with. If none is specified, it will return models with any rating.

favorites
boolean

Filter to favorites of the authenticated user (this requires an API token or session cookie).

hidden
boolean

Filter to hidden models of the authenticated user (this requires an API token or session cookie).

primaryFileOnly
boolean

Only include the primary file for each model (This will use your preferred format options if you use an API token or session cookie).

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "metadata": {}
}

getModel

path Parameters
modelId
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "type": "Checkpoint",
  • "cosmetic": { },
  • "minor": true,
  • "poi": true,
  • "nsfw": true,
  • "nsfwLevel": 0,
  • "allowNoCredit": true,
  • "allowCommercialUse": [
    ],
  • "allowDerivatives": true,
  • "allowDifferentLicense": true,
  • "stats": {
    },
  • "creator": {
    },
  • "tags": [
    ],
  • "modelVersions": [
    ]
}

getModelVersion

path Parameters
modelVersionId
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "index": 0,
  • "name": "string",
  • "baseModel": "string",
  • "baseModelType": "string",
  • "publishedAt": "2019-08-24T14:15:22Z",
  • "availability": "string",
  • "nsfwLevel": 0,
  • "description": "string",
  • "trainedWords": [
    ],
  • "earlyAccessTimeFrame": 0,
  • "files": [
    ],
  • "images": [
    ],
  • "downloadUrl": "string"
}

getModelVersionByHash

path Parameters
hash
required
string

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "index": 0,
  • "name": "string",
  • "baseModel": "string",
  • "baseModelType": "string",
  • "publishedAt": "2019-08-24T14:15:22Z",
  • "availability": "string",
  • "nsfwLevel": 0,
  • "description": "string",
  • "trainedWords": [
    ],
  • "earlyAccessTimeFrame": 0,
  • "files": [
    ],
  • "images": [
    ],
  • "downloadUrl": "string"
}

getTags

query Parameters
limit
integer <int64> [ 0 .. 200 ]
Default: 20

The number of results to be returned per page. This can be a number between 1 and 200. By default, each page will return 20 results. If set to 0, it'll return all the tags.

page
integer <int64>

The page from which to start fetching tags.

query
string

Search query to filter tags by name.

Responses

Response samples

Content type
application/json
{}