Skip to content

Feat/azure foundry anthropic messages paths - #165

Merged
swapnilroy-cell merged 2 commits into
masterfrom
feat/azure-foundry-anthropic-messages-paths
Oct 19, 2026
Merged

swapnilroy-cell merged 2 commits into
masterfrom
feat/azure-foundry-anthropic-messages-paths

Conversation

@swapnilroy-cell

Copy link
Copy Markdown

No description provided.

swapnilroy-cell and others added 2 commits October 18, 2026 20:17
Add the two workspace-scope query parameters (include_all_workspaces,
exclude_workspace_slugs) as shared OpenAPI components and reference
them alongside workspace_slug on all analytics graphs/groups/summary
endpoints. These control org-key analytics scope across workspaces and
were previously undocumented, causing AB03 permission errors when
misused as workspace_slug values.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add /messages and /messages/count_tokens paths to the OpenAPI spec.
These paths proxy the native Anthropic Messages API and are already
fully implemented in the gateway (azure-ai-inference provider).

Changes:
- Add 'Messages' tag to the tags section
- Add POST /messages path with CreateMessageRequest/Response schemas
- Add POST /messages/count_tokens path with CountMessageTokensRequest/Response schemas
- Add all Anthropic content block schemas (text, image, document, tool_use,
  tool_result, thinking, redacted_thinking)
- Add navigation group entry for the Messages section
- Document Azure AI Foundry usage: strip azure_foundry_url to /anthropic
  (not /anthropic/v1/messages); no api-version or deployment-name required
- Include code samples for cURL, Python (Anthropic SDK), JS (Anthropic SDK)

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 04:21
@swapnilroy-cell
swapnilroy-cell merged commit be764d5 into master Oct 19, 2026
1 of 2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Duplicate identifiers invalidate the specification, and workspace filtering and Messages contracts need correction.

5 open issues
What changed in this PR

Extends Portkey’s OpenAPI specification with Anthropic-native Messages endpoints, including Azure AI Foundry guidance, and cross-workspace analytics filters.

Changes:

  • Adds Messages and token-counting endpoints, schemas, examples, and navigation.
  • Documents Azure AI Foundry provider configuration.
  • Adds workspace aggregation and exclusion filters to 22 analytics operations.
File Description
openapi.yaml Defines Messages APIs and expands analytics workspace filtering.

Review effort: Balanced

Comment thread openapi.yaml
/messages:
servers: *DataPlaneServers
post:
operationId: createMessage
Comment thread openapi.yaml
Comment on lines +24017 to +24029
media_type:
type: string
enum: [application/pdf, text/plain]
description: Required when type is base64.
data:
type: string
description: Base64-encoded document data. Required when type is base64.
url:
type: string
description: URL of the document. Required when type is url.
text:
type: string
description: Plain text content. Required when type is text.
Comment thread openapi.yaml
type: integer
description: Max tokens for thinking. Required when type is enabled.

CreateMessageRequest:
Comment thread openapi.yaml
Comment on lines +358 to +360
application/json:
schema:
$ref: "#/components/schemas/CreateMessageResponse"
Comment thread openapi.yaml
name: include_all_workspaces
schema:
type: boolean
description: When `true`, returns data aggregated across all workspaces in the organisation. Only takes effect for organisation API keys; ignored for workspace API keys, which are already scoped to a single workspace. Do not combine with `workspace_slug` — if `workspace_slug` is present, it takes precedence and this parameter is ignored. One of `workspace_slug`, `include_all_workspaces`, or `exclude_workspace_slugs` is required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants