Home/AI Agent External Interaction/extension-http-outcalls
E

extension-http-outcalls

by @caffeinelabsv
4.6(120)

This skill enables backend canisters to perform HTTP GET and POST requests, facilitating seamless integration with external APIs and services. It streamlines communication between the backend and third-party systems, eliminating the need for manual, complex network request logic, thereby accelerating development and expanding the canister's functional capabilities.

http-requestsapi-integrationbackend-developmentexternal-servicesGitHub
Installation
npx skills add https://github.com/caffeinelabs/skills --skill extension-http-outcalls
compare_arrows

Before / After Comparison

1 组
Before

Before this skill, developers had to manually write complex network request code and data handling logic to enable backend canister communication with external services. This was time-consuming, error-prone, and increased development and maintenance overhead.

After

This skill provides pre-built HTTP request modules, allowing developers to integrate with external APIs with simple calls. This skill significantly reduces development time, lowers error rates, and enhances the backend service's integration capabilities.

SKILL.md

HTTP Outcalls

HTTP outcalls extension for Caffeine AI.

Overview

This skill adds the ability to make HTTP GET and POST requests from the backend canister. Useful for integrating with external APIs and services.

Backend

For HTTP outcalls that must be performed in the backend:

There is the prefabricated module mo:caffeineai-http-outcalls/outcall.mo that that cannot be modified. It provides fundamental functionality for making HTTP GET or PUT requests in the backend.

module {
  public type TransformationInput = {
    context : Blob;
    response : IC.HttpRequestResult;
  };
  public type TransformationOutput = IC.HttpRequestResult;
  public type Transform = query TransformationInput -> async TransformationOutput;
  public type Header = {
    name: Text;
    value: Text;
  };

  // Helper function for the transform callback used by the IC on HTTP outcalls.
  public func transform(input : TransformationInput) : TransformationOutput;

  // HTTP GET request with a transform callback function.
  public func httpGetRequest(url : Text, extraHeaders: [Header], transform : Transform) : async Text;

  // HTTP POST request, specifying a transform callback.
  public func httpPostRequest(url : Text, extraHeaders: [Header], body : Text, transform : Transform) : async Text;
};

Usage for GET:

import OutCall "mo:caffeineai-http-outcalls/outcall";

actor {
  public query func transform(input: OutCall.TransformationInput) : async OutCall.TransformationOutput {
    OutCall.transform(input);
  };

  func makeGetOutcall(url: Text) : async Text {
    await OutCall.httpGetRequest(url, [], transform);
  };
};

Hint: JSON parsing is not directly supported in Motoko. Better tunnel JSON to frontend for parsing.

POST usage is analogous.

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs27.5K
Rating4.6 / 5.0
Version
Updated2026年10月23日
Comparisons1

User Rating

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

Rate this Skill

0.0

Compatible Platforms

🤖claude-code

Timeline

Created2026年6月25日
Last Updated2026年10月23日
🎁 Agent Knowledge Cards
Survey