# Using Gradio API Replica URL's / Issue with --replica

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-gradio-api-replica-urls-issue-with-replica%2F83362%3E%5C
**Category:** 🤗Hub\
**Created:** [April 23, 2024, 4:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-gradio-api-replica-urls-issue-with-replica%2F83362 "2024-04-23T16:57:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![awacke1](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/awacke1/32/40934_2.png) [@awacke1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fawacke1)%5C
**Post date:** [April 23, 2024, 4:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-gradio-api-replica-urls-issue-with-replica%2F83362%2F1 "2024-04-23T16:57:47Z")

</div>

When I rebuild a T4 GPU docker my URL keeps changing to indicate the replica. E.g.:  
[https://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/y35z0/](https://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/y35z0/)

When I call the gradio app as API I would like to make the consumer impervious to a change in URL.

Will it work if I don’t include replica in the URL. e.g.  
**[https://awacke1-speech-recognition-canary-nvidiat4.hf.space/](https://awacke1-speech-recognition-canary-nvidiat4.hf.space/) ?**

My calling code uses the URL as follows:  
def transcribeWavtoTxt(filename):  
from gradio\_client import Client  
with open(filename, “rb”) as f:  
data = f.read()  
url=‘[https://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/4j9xb/](https://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/4j9xb/)’  
client = Client(url)

```
    #old URL from last build --- client = Client("https://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/0wdf4/")
    result = client.predict(
            filename,
            "English",	# Literal['English', 'Spanish', 'French', 'German'] in 'Input audio is spoken in:' Dropdown component
            "English",	# Literal['English', 'Spanish', 'French', 'German'] in 'Transcribe in language:' Dropdown component
            True,	# bool in 'Punctuation & Capitalization in transcript?' Checkbox component
            api_name="/transcribe"
    )
    return result

```

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [April 23, 2024, 5:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-gradio-api-replica-urls-issue-with-replica%2F83362%2F2 "2024-04-23T17:22:31Z")

</div>

Hello @awacke1, yes, you’re correct; there’s no need to be concerned with the replica suffix at the end of the URL, as your internal proxy will handle that aspect effectively.

---

<div class="post-metadata">

**Author:** ![awacke1](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/awacke1/32/40934_2.png) [@awacke1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fawacke1)%5C
**Post date:** [April 23, 2024, 5:36pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-gradio-api-replica-urls-issue-with-replica%2F83362%2F3 "2024-04-23T17:36:21Z")

</div>

You’re the best. Thankyou sir for quick response. Much appreciated!

–Aaron

---

<div class="post-metadata">

**Author:** ![kampaa201](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kampaa201](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkampaa201)%5C
**Post date:** [January 4, 2025, 9:50am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-gradio-api-replica-urls-issue-with-replica%2F83362%2F4 "2025-01-04T09:50:44Z")

</div>

```auto
from gradio_client import Client

# Connect to the Gradio client
client = Client("black-forest-labs/FLUX.1-schnell")

# Call the inference endpoint
result = client.predict(
    "/infer", # Endpoint
    { 
        "prompt": "Hello!!", # Input parameters
        "seed": 0,
        "randomize_seed": True,
        "width": 256,
        "height": 256,
        "num_inference_steps": 1
    }
)

result

```

this is the code and the output of code is

```auto
Loaded as API: https://black-forest-labs-flux-1-schnell.hf.space ✔
('/tmp/gradio/489613c1bc4fe4fcf1b0e5a1d10b5977449d157f9eae4ccd9b8117765eabca12/image.webp',
 653764749)

```

after that i tried to get the actual generated image and it’s not showing

the full url look like

[https://black-forest-labs-flux-1-schnell.hf.space/file=/tmp/gradio/489613c1bc4fe4fcf1b0e5a1d10b5977449d157f9eae4ccd9b8117765eabca12/image.webp](https://black-forest-labs-flux-1-schnell.hf.space/file=/tmp/gradio/489613c1bc4fe4fcf1b0e5a1d10b5977449d157f9eae4ccd9b8117765eabca12/image.webp)

```auto
{"detail":"File not found: /tmp/gradio/489613c1bc4fe4fcf1b0e5a1d10b5977449d157f9eae4ccd9b8117765eabca12/image.webp."}

```
