Skip to content

Anthropic Agents (.NET) sample uses APIKey, but the actual property is ApiKey #425

Description

@Mrknief

The C# sample under "Basic Agent Creation (Anthropic Public API)" on this page shows:

AnthropicClient client = new() { APIKey = apiKey };

This doesn't compile — Microsoft.Agents.AI.Anthropic 1.13.0-preview.260703.1 (which depends on the official Anthropic SDK 12.20.0) exposes the property as ApiKey, not APIKey (confirmed against the official C# SDK docs, which consistently use ApiKey). Hit CS0117: 'AnthropicClient' does not contain a definition for 'APIKey' following this sample verbatim.

All three code blocks on the page using this pattern (public API, Foundry API key, Foundry Azure credentials) have the same typo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions