UNPKG

openai

Version:

The official TypeScript library for the OpenAI API

103 lines 4.61 kB
import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { type Uploadable } from "../core/uploads.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class ContentProvenanceChecks extends APIResource { /** * Check whether an image or audio file contains known OpenAI provenance signals. * [Learn more about content provenance](/api/docs/guides/content-provenance). * * If `not_detected`, it means the tool did not find supported signals in the * uploaded file. The content could still have been generated by OpenAI if the * metadata was stripped or has evidence of tampering, the watermark was degraded, * it comes from a legacy generation model, or it was created before provenance * signals were available. Content could also still be AI-generated by another * company's model, which the tool currently does not detect. */ create(body: ContentProvenanceCheckCreateParams, options?: RequestOptions): APIPromise<ContentProvenanceCheck>; } export interface ContentProvenanceCheck { /** * The Unix timestamp, in seconds, when the provenance check was created. */ created_at: number; /** * The object type. Always `content_provenance_check` for this endpoint. */ object: 'content_provenance_check'; /** * The provenance results that apply to the uploaded file. Image results include * C2PA and SynthID; audio results include SynthID. */ results: Array<ContentProvenanceCheck.C2PA | ContentProvenanceCheck.SynthID>; } export declare namespace ContentProvenanceCheck { interface C2PA { /** * The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset * was generated, when available. */ generated_at: string | null; /** * The C2PA manifest issuer, when available. */ issuer: string | null; /** * The OpenAI model recorded by the provenance signal, when available. */ model: string | null; /** * Whether a supported OpenAI C2PA provenance signal was detected. If * `not_detected`, it means the tool did not find supported signals in the uploaded * file. The content could still have been generated by OpenAI if the metadata was * stripped or has evidence of tampering, the watermark was degraded, it comes from * a legacy generation model, or it was created before provenance signals were * available. Content could also still be AI-generated by another company's model, * which the tool currently does not detect. */ outcome: 'detected' | 'not_detected'; /** * The provenance signal type. Always `c2pa`. */ type: 'c2pa'; /** * The validation status of the C2PA manifest in the uploaded image. */ validation_state: 'trusted' | 'valid' | 'invalid' | 'not_present'; } interface SynthID { /** * The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset * was generated, when available. */ generated_at: string | null; /** * The OpenAI model recorded by the provenance signal, when available. */ model: string | null; /** * Whether a supported OpenAI SynthID watermark was detected. If `not_detected`, it * means the tool did not find supported signals in the uploaded file. The content * could still have been generated by OpenAI if the metadata was stripped or has * evidence of tampering, the watermark was degraded, it comes from a legacy * generation model, or it was created before provenance signals were available. * Content could also still be AI-generated by another company's model, which the * tool currently does not detect. */ outcome: 'detected' | 'not_detected'; /** * The provenance signal type. Always `synthid`. */ type: 'synthid'; } } export interface ContentProvenanceCheckCreateParams { /** * The image or audio file to check for supported OpenAI provenance signals. */ file: Uploadable; } export declare namespace ContentProvenanceChecks { export { type ContentProvenanceCheck as ContentProvenanceCheck, type ContentProvenanceCheckCreateParams as ContentProvenanceCheckCreateParams, }; } //# sourceMappingURL=content-provenance-checks.d.ts.map