Klaus shows the Geothermal Gradient chart for Mars. That's a starting point, but it's listing the best-case solution.
Rock is a great insulator
Thus the heat generated by the city (even the heat generated by your inhabitants' bodies and breathing) make this much worse. At almost any depth the excess heat of the city must be removed — and that's a question of both technology and economics. Assuming water as your heat conductor, the hydrostatic pressure on your Earth-sized planet will be a difficult to manage 969 atm (remember, sea-level pressure is 1 atm).
Most mines in operation on Earth are forced to remove water in stages due to the enormous pressure. Unless the tech allows for unbreakable pipes, the city will be forced to do the same. Every stage will have its own pump and storage tank, meaning power distribution and maintenance. Every stage is also a potential failure point.
Granted, I don't know enough about Martial geography to know what the water temperatures will be at various depths below the surface. Here on Earth, underground water gets pretty hot pretty fast. What that means is you can't use the water sourced from the city's surroundings to cool the city. You need to import water from the surface. Now you have two staging systems — one for import and one for export.
And you'll need a lot of water. It'll depend on city size, but off the top of my head we're talking about moving at least a 6-7 meter pipe worth of water up and down.
And the hot water radiators or discharge on the surface will be a target for pirates. You sure you want to do this? General George Patton is famous for saying that fixed fortifications are monuments to the stupidity of Man. An underground city is kinda the ultimate fixed fortification. Plug the hole to the surface and everybody dies. But, I'm getting ahead of myself.
Oxygen isn't the problem. CO2 is
And so is every other non-breathable gas that now has nowhere to go. The underlying basis of Climate Change is that humanity isn't paying attention to how we're using our atmosphere. We take it for granted, and in no way do we do so more than ignoring all the little things we pump into it that aren't obvious. Anyway... It's true that, technology could be believably used to solve this problem, but your story can't ignore it. Theoretically, an atmosphere is 100% recyclable. But any good scientist will tell you that 100% is really, really, really hard to achieve. There's always inefficiencies. That means some method of bringing good air in (probably not too hard...) and getting bad air out (a bit more complex...).
But this brings up an even bigger problem... sewage.
Yes, once again, theoretically 100% recyclable. However, that's unrealistic. That means disposal and gasses (see above) that come with it.
Managing air pressure
Have you ever entered a cave and noticed air rushing into the cave? Or out of it? It can do both depending on what the barometric pressure on the surface is doing. That in-rush and out-rush of air is no small thing in mining where the changes can do everything from popping ears to pulling gas out of rock.
I'm going to go out on a limb and suggest that it's not solvable by putting an airlock on the passage down to the city. It's not just the outside pressure that's the problem. Fluctuation in heat from the core (your core isn't completely cold, is it?) and the city itself can also cause pressure shifts that need to be managed, not blocked.
Finally... I'm assuming the surface isn't worthless...
Just as a lot of waste must be exported, a great amount of resources must likely be imported. The amount of farm land needed to support a city has been asked a number of times on this Stack. The simple truth is, it's hard to replace the sun when you consider everything it does — from naturally cleaning/sanitizing the surface to promoting growth to providing heat, etc. You can replace some of that with fusion generators, but (at least economically) not all of it. It takes a lot of food to feed a city, and the assumption that you can move all that food production (and its dependent effects, like solar purifying of vast amounts of water...) underground.
And we won't even talk about the psychological effect of living permanently underground or the potential need to create a diurnal habitation with a wide enough spectrum of light to not drive people stark raving mad....
What's my point?
Knowing what your maximum depth is, isn't enough unless your story depends on the result to so small a degree that it wasn't really worth asking about here. Even a partial consideration of the difficulties of an underground city (giant cavern? How are you holding it up? Massive warren of tunnels? What about the psychology of the inhabitants?) for the sake of adding depth to the description suggests that from a practical standpoint, your cities won't be anywhere near that maximum 10km depth.
A practical limit might be 0.5km.
But that brings us to the real economic driver... what can pirates do from space? There isn't a reason to be any further underground than is necessary. If the most thorough and destructive orbital bombardment can affect (including seismic effects such as concussion waves) down to 2km, then the minimum depth is 2.5-3.0 km.
It's difficult to imagine an advanced society that would dig a deeper hole than they require — if only to avoid the cost. Nothing is free, even in a society that magically doesn't use money. There is always an expenditure of resources and workforce that could be used to do other things... like feed your people.