Skip to main content
Version: 13 - TBD

ConnectorTypeCLAUDE

class connector_types.connector_type_claude.ConnectorTypeCLAUDE

Access Anthropic Claude APIs (Messages API)

Input Schema

  • schema_version = '1.0'

    Type: string

  • authentication

    Type: anyOf

  • model

    The Claude model ID to use, e.g. claude-opus-4-8, claude-sonnet-5, claude-haiku-4-5.

    Type: string

    Default: claude-opus-4-8

  • messages

    The conversation messages, as accepted by the Anthropic Messages API (a list of {"role": ..., "content": ...} objects). See https://docs.anthropic.com/en/api/messages.

  • max_tokens

    The maximum number of tokens to generate in the response. Required by the Messages API.

    Type: integer

    Default: 4096

  • system

    An optional system prompt. Left empty, no system prompt is sent.

    Type: string

  • thinking

    Optional extended/adaptive thinking configuration, e.g. {"type": "adaptive"}. Left empty, no thinking configuration is sent.

  • tools

    Optional list of tool definitions to expose to the model. Left empty, no tools are sent.

  • tool_choice

    Optional tool-choice directive, e.g. {"type": "auto"}. Left empty, no tool_choice is sent.

  • stream

    Stream the response internally (recommended). Streaming avoids HTTP timeouts on large max_tokens; the full response is still returned once complete.

    Type: boolean

    Default: True

  • kwargs

    Additional keyword arguments passed through to the Messages API (e.g. output_config, metadata, stop_sequences).

    Type: object

    Additional Properties: True

  • idempotent

    Whether re-running this connection from the start is safe (no duplicate side effects). Controls recovery after the connection between Cloudomation and the remote system is lost and later re-established (network glitch, workspace restart, ...): repeatable connections are left running to be reattached or re-run, others are cancelled. Leave unset to let the connector decide based on the operation.

Output Schema

Constants

supports_reconnect = False

Example

Anthropic API key authentication and a single message

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
result = this.connect(
connector_type='CLAUDE',
name='ask Claude',
authentication={
'authentication_method': 'anthropic_api_key',
'api_key': '...',
},
model='claude-opus-4-8',
max_tokens=1024,
messages=[
{'role': 'user', 'content': 'What is the capital of France?'},
],
).get('output_value')['result']
return this.success(result['text'])