# DiscourseApi::TooManyRequests rate limit?

**URL:** https://meta.discourse.org/t/discourseapi-toomanyrequests-rate-limit/254602
**Category:** Development
**Tags:** rest-api
**Created:** [February 9, 2023, 12:11pm UTC](https://meta.discourse.org/t/discourseapi-toomanyrequests-rate-limit/254602 "2023-02-09T12:11:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bobpies](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bobpies](https://meta.discourse.org/u/bobpies)
#### Post date: [February 9, 2023, 12:11pm UTC](https://meta.discourse.org/t/discourseapi-toomanyrequests-rate-limit/254602/1 "2023-02-09T12:11:08Z")

</div>

I’m running requests via the API and i don’t want any kind of rate limiting.

I have already changed the app.yml to include  
`DISCOURSE_MAX_ADMIN_API_REQS_PER_MINUTE: 1000`

However the error i’m getting back is to do with rate limiting per 10 secs

```plaintext
Error code: ip_10_secs_limit

```

I can see

```plaintext
DISCOURSE_MAX_REQS_PER_IP_PER_10_SECONDS

```

But this is not an admin API limit and i’d prefer to keep that

Is there an admin per\_10\_seconds limit hiding somewhere that i can’t see?

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [February 9, 2023, 1:56pm UTC](https://meta.discourse.org/t/discourseapi-toomanyrequests-rate-limit/254602/2 "2023-02-09T13:56:08Z")

</div>

> [@bobpies](#):
>
> But this is not an admin API limit

That’s your issue then. You’re setting max admin requests to 10000, and then you’re not making an admin request.

Unless I’m misunderstanding something

---

<div class="post-metadata">

### Author: ![bobpies](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bobpies](https://meta.discourse.org/u/bobpies)
#### Post date: [February 9, 2023, 2:56pm UTC](https://meta.discourse.org/t/discourseapi-toomanyrequests-rate-limit/254602/3 "2023-02-09T14:56:17Z")

</div>

but i am though

I’m using the Discourse API Ruby Gem

```plaintext
client.sync_sso(
      sso_secret: ENV['DISCOURSE_SSO_SECRET'],
      name: safe_username,
      username: safe_username,
      email: user.email,
      avatar_url: user.avatar.url(:thumb),
      avatar_force_update: true,
      external_id: user.id
    )

```

```plaintext
def client(username: "Admin_Username")
    DiscourseApi::Client.new(Rails.application.secrets.forums_hostname).tap do |discourse_client|
      discourse_client.api_key = ENV["DISCOURSE_API_KEY"]
      discourse_client.api_username = username
    end
  end

```
