Api Request logo

Api Request

Community
EmadBeltaje
api-request

Adds a BaseClient.safeApiCall method to a controller, with URL, HTTP method, return model, loading/error/success status, and optional raw JSON model. Use when the user wants an API call, HTTP request, fetch, post, BaseClient, or to load data into a screen.

Overview

PublisherEmadBeltaje
Repositoryflutter_getx_template
Skill nameapi-request
Stars
519
Forks
138
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by EmadBeltaje on GitHub. Read the source before you install it.

Installation

Install the Api Request AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/EmadBeltaje/flutter_getx_template/tree/master/.agent/skills/api-request
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/EmadBeltaje/flutter_getx_template.git /tmp/flutter_getx_template
mkdir -p .claude/skills
cp -r /tmp/flutter_getx_template/.agent/skills/api-request .claude/skills/api-request
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Api Request in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Api Request on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Api Request is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

API request

Collect anything missing, then add the call on the named controller. Models are raw fromJson / toJson classes. Do not add Hive (@HiveType, part '*.g.dart') unless the user asks for a Hive model. UserModel is Hive on purpose; new models are not.

Ask for

FieldExamples
Function namegetTodos, login
HTTP methodget, post, put, delete (RequestType)
URLfull URL or path to hang off Constants.baseUrl
Return typean existing model, or JSON plus a new model name
Controller / screene.g. home → HomeController

If any of these are missing, ask. List existing model files under lib/app/data/models/ (ignore *.g.dart) so the user can pick one.

URL

Add or reuse a constant:

dart
class Constants {
  static const baseUrl = 'https://jsonplaceholder.typicode.com';
  static const todosApiUrl = baseUrl + '/todos';
}

If the URL shares baseUrl, add static const {name}ApiUrl = baseUrl + '/{path}';. Otherwise add a full static const {name}ApiUrl = 'https://...';.

New raw model

When the user pastes JSON and a name (Todo), write lib/app/data/models/{snake}_model.dart. Example JSON:

json
{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}
dart
class TodoModel {
  final int userId;
  final int id;
  final String title;
  final bool completed;

  TodoModel({
    required this.userId,
    required this.id,
    required this.title,
    required this.completed,
  });

  factory TodoModel.fromJson(Map<String, dynamic> json) {
    return TodoModel(
      userId: json['userId'] as int,
      id: json['id'] as int,
      title: json['title'] as String,
      completed: json['completed'] as bool,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'userId': userId,
      'id': id,
      'title': title,
      'completed': completed,
    };
  }
}

Nested objects get their own classes with fromJson. Lists use List<X>.from((json['items'] as List).map((e) => X.fromJson(e))).

If they chose an existing model, import it and parse with that fromJson.

Controller method

Find {pascal}Controller for the named screen/module. If it does not exist, stop and say so (create the screen/controller first).

Keep ApiCallStatus apiCallStatus and update() on the controller. Hold the result in a field matching the return type.

GET list (getTodos → List<TodoModel>):

dart
import 'package:get/get.dart';

import '../../../../utils/constants.dart';
import '../../../data/models/todo_model.dart';
import '../../../services/api_call_status.dart';
import '../../../services/base_client.dart';

class HomeController extends GetxController {
  List<TodoModel>? data;
  ApiCallStatus apiCallStatus = ApiCallStatus.holding;

  Future<void> getTodos() async {
    await BaseClient.safeApiCall(
      Constants.todosApiUrl,
      RequestType.get,
      onLoading: () {
        apiCallStatus = ApiCallStatus.loading;
        update();
      },
      onSuccess: (response) {
        final list = response.data as List;
        data = list
            .map((e) => TodoModel.fromJson(Map<String, dynamic>.from(e)))
            .toList();
        apiCallStatus = ApiCallStatus.success;
        update();
      },
      onError: (error) {
        BaseClient.handleApiError(error);
        apiCallStatus = ApiCallStatus.error;
        update();
      },
    );
  }

  @override
  void onInit() {
    getTodos();
    super.onInit();
  }
}

POST (body via data:):

dart
  Future<void> login() async {
    await BaseClient.safeApiCall(
      Constants.loginApiUrl,
      RequestType.post,
      data: {
        'email': email,
        'password': password,
      },
      onLoading: () {
        apiCallStatus = ApiCallStatus.loading;
        update();
      },
      onSuccess: (response) {
        user = UserDto.fromJson(Map<String, dynamic>.from(response.data));
        apiCallStatus = ApiCallStatus.success;
        update();
      },
      onError: (error) {
        BaseClient.handleApiError(error);
        apiCallStatus = ApiCallStatus.error;
        update();
      },
    );
  }

RequestType is get, post, put, delete. Optional args on safeApiCall: headers, queryParameters, data. If onError is omitted, BaseClient still shows an error snackbar; still set apiCallStatus = ApiCallStatus.error in onError so the UI can show the error slot.

Call the method from onInit when the screen should load data immediately. Otherwise leave it for a button.

ApiCallStatus values: holding, loading, success, error, empty, cache, refresh.

View

The screen that shows this data uses MyWidgetsAnimator (ui-conventions). This skill only adds the request + model + URL.

Done

  • URL constant exists.
  • Raw model exists or an existing one is used (no Hive unless asked).
  • Named controller has the method, ApiCallStatus, onLoading / onSuccess / onError, and update().

Frequently asked questions

What does the Api Request AI skill do?

Adds a BaseClient.safeApiCall method to a controller, with URL, HTTP method, return model, loading/error/success status, and optional raw JSON model. Use when the user wants an API call, HTTP request, fetch, post, BaseClient, or to load data into a screen.

Why use Api Request on TypingMind?

Because you install it once and use it with any model. Api Request is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Api Request in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/EmadBeltaje/flutter_getx_template/tree/master/.agent/skills/api-request. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Api Request?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Api Request?

As many as you like. As long as a model supports skills, you can use Api Request with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Api Request AI skill free?

Yes. It is published on GitHub by EmadBeltaje under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇