Getting Started

This guide describes how to get started generating meaningful content with the Jasper API.

ℹ️

Before you start

Access to Jasper's API is currently only available for customers on the Jasper Business plan.

  • If you'd like to signup for the Business plan, please go here and request a demo to contact Jasper: https://www.jasper.ai/api
  • If you are an existing Business plan customer, please reach out to your Customer Success Manager to discuss gaining access to the API.

This guide walks through how to get started generating your first few pieces of content with the Jasper API.


Step 1: Generate an API Key

The Jasper API uses API Keys to authenticate requests. Management of API Tokens are scoped to users with the Admin or Developer role.

You can generate a token after navigating to the API Tokens page:

  • Go to the settings section in the Jasper application
  • Click on the API Tokens page in the left hand navigation

Or visit the API Tokens page directly: https://app.jasper.ai/settings/dev-tools/tokens.

Step 2: Run your first Command

The /commands endpoint provides a flexible way to generate content by passing in a command(prompt) and context (background information) for Jasper to work from. You can think of the command input as what remains constant for a given job, and the context input as a dynamic variable to further improve the output.

In this example, we will use the commands endpoint to create a product description, and pass in data we have internally about the product as context (i.e. Guitar specs).

  1. Copy the curl in the above recipe
  2. Replace your API key in the X-API-KEY header
  3. Make the API request in whatever tool you prefer (e.g. paste and run in your terminal, import into Postman, etc).

Example output:

{
    "requestId": "4cfeeb0c-7dd3-4118-876a-f1da9acd2545",
    "resource": "content",
    "data": [
        {
            "id": "txt_54bdfbd7a0064953ae42f1f6f68069de",
            "text": "Discover the perfect 8-string electric guitar for heavy metal and hard rock! The Primal Reverberations Medusa M-1 is a headless semi-hollow with a swamp ash body, Pale Moon 4A top, ebony neck and fingerboard, and two humbucking pickups. Enjoy it's high-performance Kaiju tuners, unbleached bone nut, 5-way pickup selector plus push/pull capacitance selection for alternate pick up mix variations. Unleash your inner beast today!"
        }
    ]
}

Step 3: Run your first Template

Jasper packages 40+ common content generation jobs-to-be-done into Templates (e.g. creating ads, summarizing content, repurposing existing content, optimizing content for SEO, etc), accessible via the /templates endpoint. Templates are maintained and optimized by us, which removes the need for your team to do prompt engineering, output quality measurement, and prompt optimization.

In this example, we will create a blog post using Jasper's One Shot Blog Post template.

  1. Copy the curl in the above recipe
  2. Replace your API key in the X-API-KEY header
  3. Make the API request in whatever tool you prefer (e.g. paste and run in your terminal, import into Postman, etc).

Example output:

{
    "requestId": "324bd84a-c99c-413b-a0ad-15f46b33df60",
    "resource": "content",
    "data": [
        {
            "id": "txt_4c7f1d3f7ba84ce6ae54471a48fef6b7",
            "text": "Blog Title: Why Conducting Incident Retrospectives is Critical for Software Development Teams\n\nBlog Introduction:\n\nSoftware development teams are responsible for designing, building, and maintaining software systems that support businesses' daily operations. However, with the complexity of modern-day software systems comes increased potential for incidents such as system crashes, data breaches, and other errors to occur. That's why it's crucial for software development teams to conduct incident retrospectives to identify the root cause of these issues and implement solutions that can prevent them from happening again in the future.\n\nIn this blog post, we'll explore why conducting incident retrospectives is critical for software development teams and how they provide value to organizations. We'll also discuss best practices for conducting effective retrospectives that lead to actionable insights.\n\nBlog Body:\n\n1. Identify the Root Cause of Incidents - Incident retrospectives enable software development teams to dig deep into each issue and identify its root cause. This process involves analyzing all aspects of an incident, including code changes, configurations, infrastructure changes, human error, or any other factors that may have contributed to the problem. By understanding what led to an incident in the first place, development teams can make informed decisions on how to fix it and prevent similar incidents from occurring in the future.\n\n2. Improve Team Communication - Incident retrospectives also provide an opportunity for developers and other stakeholders involved in a project to come together and discuss what went wrong. This fosters a culture of openness and encourages team members to share their thoughts and ideas freely. As a result, team communication improves significantly as everyone has a better understanding of what's going on within a project.\n\n3. Learn From Mistakes - Another critical benefit of conducting incident retrospectives is that they help teams learn from their mistakes. Through reflection on past incidents, development teams can identify patterns in their work processes or areas where they need improvement. With this knowledge at hand, they can develop new procedures or tools aimed at preventing similar incidents from happening.\n\n4. Facilitate Continuous Improvement - Incident retrospectives also facilitate continuous improvement within software development teams. By identifying the root cause of an incident, teams can implement changes to their development processes that can help prevent future incidents. Additionally, by discussing what went wrong and how it was addressed, teams can learn from one another and improve their overall skillsets.\n\n5. Build Trust with Stakeholders - Finally, effective incident retrospectives can help build trust between software development teams and stakeholders. By demonstrating a commitment to transparency and accountability, teams can show that they are taking steps to ensure that incidents won't happen again in the future. This can lead to more significant investments in projects and increased support for new initiatives.\n\nConclusion:\n\nConducting incident retrospectives is critical for software development teams as it allows them to identify the root cause of issues, improve team communication, learn from mistakes, facilitate continuous improvement, and build trust with stakeholders. To make the most out of these retrospectives, it's essential to follow best practices such as gathering data before the retrospective meeting, creating a blame-free environment during discussions, prioritizing action items after each retrospective meeting, among others.\n\nBy conducting regular incident retrospectives and implementing solutions based on insights gained from these meetings, software development teams can ensure that their systems are always running smoothly while building trust with stakeholders within their organizations."
        }
    ]
}

Next Steps

These are just a few examples of generating content with the Jasper API. Now that you have made your first few API calls, we recommend you check out the following guides:

We also offer Tools & Integrations to make getting started with the Jasper API easier: