Skip to content

OpenAI vs Anthropic shape

The ai& Files API is a single endpoint that responds in two shapes — selected by whether your request carries an anthropic-version header.

This means both the official openai SDK and the anthropic SDK work against the same URL, with the same API key, without any code changes.

HeaderResponse shape
anthropic-version: <any>Anthropic Files API shape
(header absent)OpenAI Files API shape
Terminal window
curl https://api.aiand.com/v1/files/file-abc123 \
-H "Authorization: Bearer sk-..."
{
"id": "file-abc123",
"object": "file",
"bytes": 12345,
"created_at": 1716960000,
"filename": "cat.png",
"purpose": "vision"
}
  • The OpenAI Python SDK’s client.files.create(...) works as-is.
  • The Anthropic Python SDK’s client.beta.files.upload(...) works as-is.
  • You can upload via one SDK and read back via the other — same file_id either way.