ConnectorTypeCLAUDE
class connector_types.connector_type_claude.ConnectorTypeCLAUDE
Access Anthropic Claude APIs (Messages API)
Input Schema
-
schema_version = '1.0'Type:
string -
authenticationType:
anyOfOptions: -
modelThe Claude model ID to use, e.g.
claude-opus-4-8,claude-sonnet-5,claude-haiku-4-5.Type:
stringDefault:
claude-opus-4-8 -
messagesThe conversation messages, as accepted by the Anthropic Messages API (a list of
{"role": ..., "content": ...}objects). See https://docs.anthropic.com/en/api/messages. -
max_tokensThe maximum number of tokens to generate in the response. Required by the Messages API.
Type:
integerDefault:
4096 -
systemAn optional system prompt. Left empty, no system prompt is sent.
Type:
string -
thinkingOptional extended/adaptive thinking configuration, e.g.
{"type": "adaptive"}. Left empty, no thinking configuration is sent. -
toolsOptional list of tool definitions to expose to the model. Left empty, no tools are sent.
-
tool_choiceOptional tool-choice directive, e.g.
{"type": "auto"}. Left empty, no tool_choice is sent. -
streamStream the response internally (recommended). Streaming avoids HTTP timeouts on large
max_tokens; the full response is still returned once complete.Type:
booleanDefault:
True -
kwargsAdditional keyword arguments passed through to the Messages API (e.g.
output_config,metadata,stop_sequences).Type:
objectAdditional Properties:
True -
idempotentWhether 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 = FalseExample
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'])