For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
BlogLog InRequest Demo
HomeProductDevelopersSelf-HostingChangelog
HomeProductDevelopersSelf-HostingChangelog
  • Getting Started
    • Overview
  • Workflows SDK
    • Introduction
    • Installation
    • Core Concepts
    • Defining Control Flow
    • Configuration
    • Custom Docker Images
      • Displayable Nodes
        • Agent Node
        • Inline Prompt Node
        • Inline Subworkflow Node
        • Prompt Deployment Node
        • Search Node
        • Subworkflow Deployment Node
        • API Node
        • Code Execution Node
        • Templating Node
        • Guardrail Node
        • Map Node
        • Conditional Node
        • Merge Node
        • Error Node
        • Final Output Node
      • Datasets
      • CLI
  • Client SDK
    • Introduction
    • Authentication
    • API Versioning
LogoLogo
BlogLog InRequest Demo
Workflows SDKAPI ReferenceDisplayable Nodes

API Node

1from vellum.workflows.nodes import APINode
2
3class MyAPINode(APINode):
4 url = "https://api.example.com/data"
5 method = "POST"
6 timeout = 30 # Maximum 30 seconds for the request
7 headers = {
8 "Authorization": "Bearer ${secrets.API_KEY}",
9 "Content-Type": "application/json"
10 }
11 json = {
12 "query": "example",
13 "filters": {
14 "category": "books",
15 "limit": 10
16 }
17 }
Was this page helpful?
Previous

Code Execution Node

Next
Built with

vellum.workflows.nodes.APINode

Used to make HTTP requests to external APIs.

Attributes

url
strRequired

The URL to send the request to.

method
APIRequestMethodRequired

The HTTP method to use for the request.

headers
Optional[Dict[str, Union[str, VellumSecret]]]

The headers to send in the request.

data
Optional[str]

The data to send in the request body.

json
Optional[JsonObject]

The JSON data to send in the request body.

authorization_type
Optional[AuthorizationType]

The type of authorization to use for the API call.

api_key_header_key
Optional[str]

The header key to use for the API key authorization.

bearer_token_value
Optional[str]

The bearer token value to use for the bearer token authorization.

timeout
Optional[int]

The maximum number of seconds to wait for the API request to complete. If not specified, the request will use the default timeout behavior.

Outputs

status_code
int

The HTTP status code of the response

headers
Dict[str, str]

The response headers

text
str

The raw text response body

json
Optional[Dict[str, Any]]

The parsed JSON response body (if the response is JSON)