OpenAI 内容来源验证
使用内容来源 API 检查图像或音频是否包含受支持的 OpenAI 来源信号。将文件发送至 POST /v1/content_provenance_checks,同一次响应就会返回已完成的验证结果,可用于内容审查、事实核查、标注及信任与安全工作流。
也可以在浏览器中使用 OpenAI 验证工具。请求参数和响应结构见内容来源接口参考。文本验证需要申请访问,目前仅向获批组织开放,包括 AI 研究与学术机构;OpenAI 会逐一审核申请。
not_detected 表示未在上传文件中发现受支持的信号,不能证明内容由人创作。即使内容由 OpenAI 生成,元数据被移除或篡改、水印退化、使用旧生成模型,或生成时间早于来源信号推出时间,都可能出现这一结果。目前也不检测其他公司的 AI 模型生成内容,因此该结果同样不能排除这些来源。
内容来源检查检测什么
| 信号 | 适用对象 | 检查内容 |
|---|---|---|
| C2PA 内容凭证 | 图像 | 包含签发者及 AI 使用详情的签名元数据 |
| SynthID | 图像和音频 | 直接嵌入受支持媒体中的水印 |
C2PA 元数据提供文件来源背景,但编辑、转换或分享可能移除元数据。SynthID 是图像或音频本身的一部分,在某些变换后仍可能保留。
此 API 检测受支持的 OpenAI 信号,不是识别所有 AI 系统生成内容的通用检测器。可见水印、标签与此 API 检查的来源信号是不同概念。
验证文件
通过 OpenAI SDK 将图像或音频作为 file 字段发送。SDK 会构建 multipart 请求,并从 OPENAI_API_KEY 环境变量读取 API 密钥。
验证图像:
来源示例 1(javascript):
// [中文] 将一个文件作为 multipart 的 file 上传并同步读取验证结果;Opus 使用 audio/ogg。not_detected 不能证明人工创作,也不检测所有提供商。
import { createReadStream } from "node:fs";
import OpenAI, { toStreamingFile } from "openai";
const client = new OpenAI();
const result = await client.contentProvenanceChecks.create({
file: toStreamingFile(createReadStream("myimage.png"), "myimage.png", {
type: "image/png",
}),
});
console.log(result);
来源示例 2(python):
## [中文] 将一个文件作为 multipart 的 file 上传并同步读取验证结果;Opus 使用 audio/ogg。not_detected 不能证明人工创作,也不检测所有提供商。
from openai import OpenAI
client = OpenAI()
with open("./example.png", "rb") as image:
result = client.content_provenance_checks.create(
file=("example.png", image, "image/png"),
)
print(result)
来源示例 3(go):
// [中文] 将一个文件作为 multipart 的 file 上传并同步读取验证结果;Opus 使用 audio/ogg。not_detected 不能证明人工创作,也不检测所有提供商。
package main
import (
"context"
"fmt"
"os"
"github.com/openai/openai-go/v3"
)
func main() {
client := openai.NewClient()
image, err := os.Open("./example.png")
if err != nil {
panic(err)
}
defer image.Close()
result, err := client.ContentProvenanceChecks.New(
context.Background(),
openai.ContentProvenanceCheckNewParams{
File: openai.File(image, "example.png", "image/png"),
},
)
if err != nil {
panic(err)
}
fmt.Println(result)
}
来源示例 4(java):
// [中文] 将一个文件作为 multipart 的 file 上传并同步读取验证结果;Opus 使用 audio/ogg。not_detected 不能证明人工创作,也不检测所有提供商。
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.contentprovenancechecks.ContentProvenanceCheckCreateParams;
import java.nio.file.Path;
var result =
client
.contentProvenanceChecks()
.create(
ContentProvenanceCheckCreateParams.builder().file(Path.of("myimage.png")).build());
System.out.println(result);
来源示例 5(ruby):
## [中文] 将一个文件作为 multipart 的 file 上传并同步读取验证结果;Opus 使用 audio/ogg。not_detected 不能证明人工创作,也不检测所有提供商。
require "openai"
require "pathname"
client = OpenAI::Client.new
image = OpenAI::FilePart.new(Pathname("./example.png"), content_type: "image/png")
result = client.content_provenance_checks.create(file: image)
puts result
来源示例 6(bash):
## [中文] 将一个文件作为 multipart 的 file 上传并同步读取验证结果;Opus 使用 audio/ogg。not_detected 不能证明人工创作,也不检测所有提供商。
curl https://api.openai.com/v1/content_provenance_checks \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-F "file=@./example.png;type=image/png"
SDK 至少使用 Python 2.52.0、Go 3.49.0、Ruby 0.75.0。验证 Opus 音频时使用同一端点,将文件媒体类型设为 audio/ogg:
来源示例 7(bash):
## [中文] 将一个文件作为 multipart 的 file 上传并同步读取验证结果;Opus 使用 audio/ogg。not_detected 不能证明人工创作,也不检测所有提供商。
curl https://api.openai.com/v1/content_provenance_checks \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-F "file=@./example.opus;type=audio/ogg"
响应直接包含完整结果。图像结果示例:
来源示例 8(json):
中文说明:结果对象展示检测信号及状态;字段可为空,not_detected不是人工创作证明。
{
"object": "content_provenance_check",
"created_at": 1778000000,
"results": [
{
"type": "c2pa",
"outcome": "detected",
"validation_state": "trusted",
"issuer": "OpenAI OpCo, LLC",
"model": "gpt-image",
"generated_at": "2026-07-27T18:34:12Z"
},
{
"type": "synthid",
"outcome": "not_detected",
"model": null,
"generated_at": null
}
]
}
object 标识响应对象类型,created_at 是检查创建时间,采用以秒为单位的 Unix 时间戳。results 中的条目取决于文件类型:图像包含 C2PA 和 SynthID 结果,音频包含 SynthID 结果。不适用的检查会被省略,而不是返回 not_detected。
验证会在接口返回前完成,无须创建后台任务、轮询其他端点或先向 Files API 上传文件。
请求失败时检查 HTTP 状态和可用的 error.code。文件格式错误、不受支持或被阻止返回 400;组织没有访问权限返回 404;超过速率限制返回 429。仅对限流、服务器错误等暂时性故障重试。参见 API 错误代码。
理解验证结果
分别读取 results 中每个适用条目:图像有 C2PA、SynthID,音频有 SynthID。响应没有顶层 outcome。
C2PA 结果
C2PA 结果描述图像内容凭证的状态:
来源示例 9(json):
中文说明:结果对象展示检测信号及状态;字段可为空,not_detected不是人工创作证明。
{
"type": "c2pa",
"outcome": "detected",
"validation_state": "trusted",
"issuer": "OpenAI OpCo, LLC",
"model": "gpt-image",
"generated_at": "2026-07-27T18:34:12Z"
}
outcome:是否检测到由 OpenAI 签发的 AI 生成凭证,值为detected或not_detected。validation_state:清单验证状态,值为trusted、valid、invalid或not_present。issuer:可用时给出清单签发者。model:可用时给出生成模型。generated_at:可用时给出内容生成时间。
只有 trusted 或 valid 清单将 OpenAI 标识为签发者,并包含 AI 生成操作时,outcome 才为 detected。第三方清单、没有 AI 生成操作的清单、invalid 或 not_present 清单都产生 not_detected;此时 issuer 和 validation_state 仍可能提供清单信息。
不要把 invalid 清单当作可靠来源证据。not_present 表示图像没有可用的 C2PA 清单。
SynthID 结果
SynthID 结果描述是否在图像或音频中检测到受支持的水印:
来源示例 10(json):
中文说明:结果对象展示检测信号及状态;字段可为空,not_detected不是人工创作证明。
{
"type": "synthid",
"outcome": "detected",
"model": null,
"generated_at": null
}
detected 表示包含已识别水印;not_detected 表示没有检测到该水印,不能排除内容由 AI 生成或修改。model、generated_at 在信息可用时提供模型与生成时间,任一字段都可能为 null。
支持的上传文件
默认支持 PNG、JPEG、WebP 和 GIF 图像,以及 MP3、Opus、AAC、FLAC、WAV、PCM 音频。每个文件不得超过 50 MiB,音频解码后的时长不得超过 60 秒。
设置上传的 file 部分的媒体类型,例如 GIF 用 image/gif,PNG 用 image/png,Opus 用 audio/ogg。不要另外添加 type 字段,也不要手动设置 multipart/form-data 请求头。curl -F 会设置内容类型和 multipart 边界。每次请求发送一个文件。
速率限制
接口采用严格速率限制以防滥用。组织可以申请提高限额,OpenAI 逐一审核。
返回 429 rate_limit_exceeded 时降低请求频率,并遵守存在时的 Retry-After 请求头。一般重试策略见速率限制。
负责任地使用验证结果
将结果作为整体审查流程中的证据:
detected是某种受支持信号的证据,不代表文件的完整历史。not_detected是没有检测到证据,不是人工创作或未使用 OpenAI 的证明。- 将图像归因给某个提供商前,检查 C2PA 签发者。
- 尽量验证原始文件;压缩、裁剪、截图、移除元数据和格式转换可能消除或削弱信号。
- 考虑来源产品、模型、格式和创建日期,并非所有 OpenAI 生成内容都带有受支持信号。
- 在高风险工作流中结合人工审查。
- 不要通过重复查询逆向推断、移除或规避水印。
- 不要根据验证结果推断提示词、账户或具体创作者。
使用此 API 受 OpenAI 服务协议约束。平台范围的监控和保留设置见数据控制。

TRAE-AI编程


更多建议: