Logo de Iri Api

Iri Api

Organização
AI-ModCon
iri-api

Use this skill to work with IRI API deployments at NERSC (https://api.iri.nersc.gov) and ALCF (https://api.alcf.anl.gov) via reproducible scripts, including Globus token lifecycle management (status, refresh, interactive login) and OpenAPI-driven endpoint execution for facility/status/account/compute/filesystem/task workflows. Trigger this skill when the task mentions IRI API, openapi.json-driven calls, authenticated endpoint access, job submission/status/cancel, file operations, task polling/cleanup, or running jobs on Perlmutter or Polaris.

Visão geral

Publicado porAI-ModCon
Repositóriogenesis-skills
Nome da habilidadeiri-api
Estrelas
37
Forks
16
Arquivos incluídos
18
LicençaBSD-2-Clause
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • 18 arquivos incluídos

    Scripts, modelos de documentos e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente leitura e nunca são executados.

  • Código aberto

    Publicada por AI-ModCon no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Iri Api no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/AI-ModCon/genesis-skills/tree/main/skills/amsc-skills/iri-api
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AI-ModCon/genesis-skills.git /tmp/genesis-skills
mkdir -p .claude/skills
cp -r /tmp/genesis-skills/skills/amsc-skills/iri-api .claude/skills/iri-api
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Iri Api em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Iri Api automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Iri Api não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

IRI API

Use scripted workflows. Prefer the bundled scripts over hand-written curl commands.

Deployments

SiteBase URLAuth scriptReference
NERSC (Perlmutter)https://api.iri.nersc.gov (default)scripts/token_manager.py ensure --facilities nerscreferences/NERSC.md
ALCF (Polaris)https://api.alcf.anl.govscripts/token_manager.py ensure --facilities alcfreferences/ALCF.md

Before doing any work, read the reference file for the relevant site. Do not proceed from memory.

Use the unified token manager for both sites. By default it can manage both NERSC and ALCF tokens together, but when the user is focused on one site, scope it with --facilities nersc or --facilities alcf.

--facility is a global flag on iri_api_call.py and must come before the subcommand:

bash
# Correct
python3 scripts/iri_api_call.py --facility nersc call --operation-id getProjects --ensure-token
python3 scripts/iri_api_call.py --facility alcf call --operation-id launchJob ...

# Wrong
python3 scripts/iri_api_call.py call --facility nersc --operation-id getProjects

--base-url and --openapi-url follow the same rule: they are global flags and must also come before the subcommand.

Quick Start

  1. Check token state:
bash
python3 scripts/token_manager.py status --json
  1. Ensure a usable token for authenticated endpoints:
bash
python3 scripts/token_manager.py ensure --min-ttl 300

If the IRI API still returns 401, force a fresh identity-provider login:

bash
python3 scripts/token_manager.py ensure --force-login --prompt-login --validate-iri
  1. List available operations from OpenAPI:
bash
python3 scripts/iri_api_call.py --facility nersc list-operations
python3 scripts/iri_api_call.py --facility alcf list-operations
  1. Call an endpoint by operationId:
bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getResources
python3 scripts/iri_api_call.py --facility alcf call --operation-id getResources

Token Management

Use scripts/token_manager.py for all token lifecycle actions.

  • Check token state:
bash
python3 scripts/token_manager.py status --json
python3 scripts/token_manager.py status --facilities nersc --json
python3 scripts/token_manager.py status --facilities alcf --json
  • Ensure usable tokens:
bash
python3 scripts/token_manager.py ensure --min-ttl 300
python3 scripts/token_manager.py ensure --facilities nersc --min-ttl 300
python3 scripts/token_manager.py ensure --facilities alcf --min-ttl 300
  • Refresh or login for selected facilities only:
bash
python3 scripts/token_manager.py ensure --facilities nersc --refresh-only
python3 scripts/token_manager.py ensure --facilities alcf --refresh-only
  • Validate the facility token against the matching API:
bash
python3 scripts/token_manager.py ensure --facilities nersc --validate-iri --validate-facility nersc
python3 scripts/token_manager.py ensure --facilities alcf --validate-iri --validate-facility alcf
  • Print selected facility access tokens:
bash
python3 scripts/token_manager.py ensure --print-token
python3 scripts/token_manager.py ensure --facilities alcf --print-token

Notes:

  • Default token file: ~/.globus/auth_tokens.json
  • The saved file preserves the full Globus token response, including other_tokens.
  • The usable IRI API bearer token is extracted from other_tokens, not the top-level Globus Auth token.
  • Required scopes are enforced by script validation.
  • globus-sdk is required for refresh/login operations.
  • If validation reports empty session_info.authentications, re-run with --force-login --prompt-login and complete the flow in a Chrome incognito window.

Endpoint Execution

Use scripts/iri_api_call.py for all API calls.

Operation Discovery

  • List all operations:
bash
python3 scripts/iri_api_call.py --facility nersc list-operations
python3 scripts/iri_api_call.py --facility alcf list-operations
  • See generated static reference: references/operations.md

Public Endpoints (No Token Required)

Examples:

bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getFacility
python3 scripts/iri_api_call.py --facility nersc call --operation-id getIncidents
python3 scripts/iri_api_call.py --facility nersc call --operation-id getResource --path-param resource_id=perlmutter

Authenticated Endpoints (Token Required)

Use --ensure-token so calls auto-refresh/login if needed.

  • Account / project context:
bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getProjects --ensure-token
python3 scripts/iri_api_call.py --facility alcf call --operation-id getProjects --ensure-token
  • Submit compute job (request body from file):
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id launchJob \
  --path-param resource_id=perlmutter \
  --json-file /path/to/job.json \
  --ensure-token
  • Query one job:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id getJob \
  --path-param resource_id=perlmutter \
  --path-param job_id=12345 \
  --ensure-token
  • Cancel job:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id cancelJob \
  --path-param resource_id=perlmutter \
  --path-param job_id=12345 \
  --ensure-token
  • Filesystem list/view:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id ls \
  --path-param resource_id=perlmutter \
  --query path=/global/cfs/cdirs \
  --ensure-token

python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id view \
  --path-param resource_id=perlmutter \
  --query path=/path/to/file.txt \
  --ensure-token
  • Upload file:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id upload \
  --path-param resource_id=perlmutter \
  --query path=/path/on/resource/target.dat \
  --upload-file /local/path/source.dat \
  --ensure-token
  • Poll task state:
bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getTasks --ensure-token
python3 scripts/iri_api_call.py --facility nersc call --operation-id getTask --path-param task_id=<task_id> --ensure-token

Shared Parameter Rules

  • Prefer --operation-id over manual --method/--path.
  • Provide required path params via repeated --path-param key=value.
  • Provide query params via repeated --query key=value.
  • Use one of:
    • --json-file /path/to/body.json
    • --json-body '{"key":"value"}'
    • --upload-file /path/to/local.file for multipart endpoints
  • For binary or large outputs, use --output-file /path/to/out.bin.
  • Use --facility nersc or --facility alcf on scripts/iri_api_call.py so the API server and bearer token selection stay aligned.

Job Construction Guidance

Before generating a compute job request, check whether the user wants any of the following:

  • A multistep job with multiple srun or mpiexec lines.
  • Additional job-control behavior that is not covered by the API attributes fields.
  • Explicit affinity or binding control beyond the basic resource request.

If any of those are needed, use a pre_launch or post_launch script to carry that logic instead of trying to force it into a single launch line or into unsupported attributes.

Rules for these scripts:

  • Do not include #SBATCH or #PBS directives in pre_launch or post_launch.
  • The scheduler directives belong in the batch script generated by the API server, not inside the pre/post scripts.
  • Put extra srun or mpiexec lines, affinity settings, environment setup, and teardown logic in those scripts as plain shell commands.
  • For NERSC-oriented launch structure and Slurm examples, use https://docs.nersc.gov/jobs/examples/.
  • For ALCF-oriented launch structure and PBS examples, use https://docs.alcf.anl.gov/running-jobs/example-job-scripts/#cpu-mpi-openmp-examples.

Reproducibility and Reference Refresh

Regenerate endpoint reference after OpenAPI updates:

bash
python3 scripts/generate_operation_reference.py \
  --openapi references/openapi.json \
  --output references/operations.md

Regenerate request payload templates:

bash
python3 scripts/generate_examples.py

Use templates from references/examples/:

  • compute-launch-job.json
  • compute-status-filters.json
  • filesystem-mkdir.json
  • filesystem-mv.json
  • filesystem-cp.json
  • filesystem-compress.json
  • filesystem-extract.json
  • filesystem-chmod.json
  • filesystem-chown.json

Example calls using generated templates:

bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id launchJob \
  --path-param resource_id=perlmutter \
  --json-file references/examples/compute-launch-job.json \
  --ensure-token

python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id mkdir \
  --path-param resource_id=perlmutter \
  --json-file references/examples/filesystem-mkdir.json \
  --ensure-token

Useful Endpoint Groups

  • Facility + status (public): infrastructure metadata and incident visibility.
  • Account (auth): user projects and allocation hierarchy.
  • Compute (auth): submit/update/status/cancel jobs.
  • Filesystem (auth): list/read/write/upload/download and file operations.
  • Task (auth): check asynchronous task progress and cleanup.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Iri Api faz?

Use this skill to work with IRI API deployments at NERSC (https://api.iri.nersc.gov) and ALCF (https://api.alcf.anl.gov) via reproducible scripts, including Globus token lifecycle management (status, refresh, interactive login) and OpenAPI-driven endpoint execution for facility/status/account/compute/filesystem/task workflows. Trigger this skill when the task mentions IRI API, openapi.json-driven calls, authenticated endpoint access, job submission/status/cancel, file operations, task polling/cleanup, or running jobs on Perlmutter or Polaris.

Por que usar Iri Api no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Iri Api é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Iri Api no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/AI-ModCon/genesis-skills/tree/main/skills/amsc-skills/iri-api. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Iri Api?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Iri Api?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Iri Api com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Iri Api é gratuita?

Sim. A habilidade é publicada no GitHub por AI-ModCon sob a licença BSD-2-Clause. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇