OpenAI API

Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.

delete
https://api.openai.com/v1/models/{model}

Path Parameters

modelstringrequired

The model to delete

Example:ft:gpt-4o-mini:acemeco:suffix:abc123

Response

200 application/json

OK

DeleteModelResponse

idstringrequired
deletedbooleanrequired
objectstringrequired
delete/models/{model}
 
200 application/json

Moderations

Given text and/or image inputs, classifies if those inputs are potentially harmful.

Classifies if text and/or image inputs are potentially harmful. Learn more in the [moderation guide](/docs/guides/moderation).

post
https://api.openai.com/v1/moderations

Body

application/json

CreateModerationRequest

inputOne Of
required

Input (or inputs) to classify. Can be a single string, an array of strings, or
an array of multi-modal input objects similar to other models.

Variant 1string

A string of text to classify for moderation.

Default:

Example:I want to kill them.

modelAny Of

The content moderation model you would like to use. Learn more in
the moderation guide, and learn about
available models here.

Default:omni-moderation-latest

Example:omni-moderation-2024-09-26

Variant 1string

Response

200 application/json

OK

CreateModerationResponse

Represents if a given text input is potentially harmful.

idstringrequired

The unique identifier for the moderation request.

modelstringrequired

The model used to generate the moderation results.

resultsarray[object]required

A list of moderation objects.

Show Child Parameters
post/moderations

Body

{ "input": "I want to kill them." }
 
200 application/json

Audit Logs

List user actions and configuration changes within this organization.

List user actions and configuration changes within this organization.

get
https://api.openai.com/v1/organization/audit_logs

Query Parameters

effective_atobject

Return only events whose effective_at (Unix seconds) is in this range.

Show Child Parameters
project_ids[]array[string]

Return only events for these projects.

event_types[]array[string]

The event type.

Allowed values:api_key.createdapi_key.updatedapi_key.deletedinvite.sentinvite.acceptedinvite.deletedlogin.succeededlogin.failedlogout.succeededlogout.failedorganization.updatedproject.createdproject.updatedproject.archivedservice_account.createdservice_account.updatedservice_account.deletedrate_limit.updatedrate_limit.deleteduser.addeduser.updateduser.deleted

actor_ids[]array[string]

Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.

actor_emails[]array[string]

Return only events performed by users with these emails.

resource_ids[]array[string]

Return only events performed on these targets. For example, a project ID updated.

limitinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Default:20

afterstring

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

beforestring

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Response

200 application/json

Audit logs listed successfully.

ListAuditLogsResponse

objectstringrequired

Allowed values:list

dataarray[object]required

A log of a user action or configuration change within this organization.

Show Child Parameters
first_idstringrequired

Example:audit_log-defb456h8dks

last_idstringrequired

Example:audit_log-hnbkd8s93s

has_morebooleanrequired
get/organization/audit_logs
 
200 application/json