# RubyGems gem API

Look up RubyGems releases by name or URL via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as name, output, and retrieve structured data including gem name, resolved version, resolved platform build, runtime dependency constraint, and package SHA-256 checksum for release inventory, and dependency review.

Documentation: https://openany.si/rubygems/rubygems-gem-api/8ae10987-f4f6-4a5e-a1a7-8c27755ec2b1/
API ID: 8ae10987-f4f6-4a5e-a1a7-8c27755ec2b1
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/rubygems/v1/gem
Page update time: 2026-12-03T02:45:30.517Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:45:29.102Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## RubyGems Gem API

Provide name, optionally version, and platform when selecting a platform build for that version. The response separates runtime from development dependencies and retains the resolved version, platform and package checksum.

## What You Can Build

- **Release inventory**: Record resolved version and platform with checksum metadata.
- **Dependency review**: Keep development requirements separate from runtime constraints.

## Returned Data

| Field | Meaning |
| --- | --- |
| `name` | Gem name |
| `version` | Resolved version |
| `platform` | Resolved platform build |
| `dependencies.runtime[].requirements` | Runtime dependency constraint |
| `sha256` | Package SHA-256 checksum |
| `yanked` | Source withdrawal flag |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "RubyGems gem API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Gem name (rails), a `gem install` / Gemfile line or a rubygems.org link."
        },
        "version": {
          "type": "string",
          "description": "A version such as 7.1.0 (default: the latest)."
        },
        "platform": {
          "type": "string",
          "description": "With version: the platform build, e.g. ruby, x86_64-linux or java."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "Native CSV/NDJSON record selector; it has no effect on this JSON-only product."
        }
      },
      "required": [
        "name"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "authors": {
      "type": "string"
    },
    "cached": {
      "type": "boolean"
    },
    "credits_used": {
      "type": "integer"
    },
    "dependencies": {
      "type": "object",
      "properties": {
        "development": {
          "type": "array",
          "items": {}
        },
        "runtime": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "requirements": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "string"
              }
            ]
          }
        }
      }
    },
    "downloads": {
      "type": "integer"
    },
    "gem_url": {
      "type": "string"
    },
    "licenses": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "bug_tracker": {
          "type": "string"
        },
        "changelog": {
          "type": "string"
        },
        "documentation": {
          "type": "string"
        },
        "funding": {
          "type": "null"
        },
        "homepage": {
          "type": "string"
        },
        "mailing_list": {
          "type": "string"
        },
        "source_code": {
          "type": "string"
        },
        "wiki": {
          "type": "null"
        }
      }
    },
    "metadata": {
      "type": "object",
      "properties": {
        "bug_tracker_uri": {
          "type": "string"
        },
        "changelog_uri": {
          "type": "string"
        },
        "documentation_uri": {
          "type": "string"
        },
        "mailing_list_uri": {
          "type": "string"
        },
        "rubygems_mfa_required": {
          "type": "string"
        },
        "source_code_uri": {
          "type": "string"
        }
      }
    },
    "name": {
      "type": "string"
    },
    "platform": {
      "type": "string"
    },
    "ruby_abi": {
      "type": "null"
    },
    "sha256": {
      "type": "string"
    },
    "summary": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "version_created_at": {
      "type": "string"
    },
    "version_downloads": {
      "type": "integer"
    },
    "yanked": {
      "type": "boolean"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/rubygems/v1/gem?name=rails&output=json' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "authors": "David Heinemeier Hansson",
  "cached": false,
  "credits_used": 1,
  "dependencies": {
    "development": [],
    "runtime": [
      {
        "name": "actioncable",
        "requirements": "= 8.1.4.1"
      },
      {
        "name": "actionmailbox",
        "requirements": "= 8.1.4.1"
      },
      "… 11 more"
    ]
  },
  "downloads": 812691506,
  "gem_url": "https://rubygems.org/gems/rails-8.1.4.1.gem",
  "licenses": [
    "MIT"
  ],
  "links": {
    "bug_tracker": "https://github.com/rails/rails/issues",
    "changelog": "https://github.com/rails/rails/releases/tag/v8.1.4.1",
    "documentation": "https://api.rubyonrails.org/v8.1.4.1/",
    "funding": null,
    "homepage": "https://rubyonrails.org",
    "mailing_list": "https://discuss.rubyonrails.org/c/rubyonrails-talk",
    "source_code": "https://github.com/rails/rails/tree/v8.1.4.1",
    "wiki": null
  },
  "metadata": {
    "bug_tracker_uri": "https://github.com/rails/rails/issues",
    "changelog_uri": "https://github.com/rails/rails/releases/tag/v8.1.4.1",
    "documentation_uri": "https://api.rubyonrails.org/v8.1.4.1/",
    "mailing_list_uri": "https://discuss.rubyonrails.org/c/rubyonrails-talk",
    "rubygems_mfa_required": "true",
    "source_code_uri": "https://github.com/rails/rails/tree/v8.1.4.1"
  },
  "name": "rails",
  "platform": "ruby",
  "ruby_abi": null,
  "sha256": "365c3a0ad2713bd6e60628e5e826622d4ca8dee60b5a7e560e9b20844e9650bc",
  "summary": "Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by…",
  "url": "https://rubygems.org/gems/rails",
  "version": "8.1.4.1",
  "version_created_at": "2026-11-04T02:47:52.512Z",
  "version_downloads": 424774,
  "yanked": false
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### What is selected when version is omitted?
The latest version is selected. Read the returned version and platform to identify the result.

### How do I choose a platform build?
With version set, use platform such as ruby, x86_64-linux or java.

### Are development dependencies production requirements?
No. dependencies.development and dependencies.runtime represent different dependency scopes.

### Does this install the gem?
No. The endpoint returns package metadata and links, including gem_url when available.

### How do I bypass cached results?
Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

### Can I request CSV or NDJSON?
This OpenAny implementation serves JSON only. Omit output or set output=json.

## Available implementations
- apish: https://openany.si/rubygems/rubygems-gem-api/8ae10987-f4f6-4a5e-a1a7-8c27755ec2b1/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
